Thursday, 25 April 2019
creating array of object in php
creating array of object in php
<?php
$object = new stdClass();
$object->content="";
$object->content="pawan";
$object1=array();
array_push($object1,$object);
//print_r($object1);
echo $object1[0]->content;
$object = new stdClass();
$object->content="";
$object->content="pawan";
$object1=array();
array_push($object1,$object);
//print_r($object1);
echo $object1[0]->content;
?>
Thursday, 18 April 2019
Wednesday, 17 April 2019
bind and apply
https://medium.com/@ivansifrim/the-differences-between-call-apply-bind-276724bb825b
javascript bind example
javascript bind example
let obj = {things: 3};
let addThings = function(a, b, c){
return this.things + a + b + c;
};
let fn=addThings.bind(obj);
//bind will return the function copy and obj parameter which took place of this.
fn(1,2,3);
//console.log( addThings.bind(obj)(1,4,6) );
Monday, 15 April 2019
Wednesday, 10 April 2019
node js rds connection
var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'amazon-string.rds.amazonaws.com',
user : 'myusername',
password : 'mypassword'
});
connection.connect();
exports.handler = (event, context) => {
connection.query("SELECT * FROM table", function(err, rows, fields) {
console.log("rows: " + rows);
context.succeed('Success');
});
};
Friday, 5 April 2019
git tag creation
https://stackoverflow.com/questions/18216991/create-a-tag-in-a-github-repository
git push origin --tags
git push origin <tag>
Tuesday, 2 April 2019
Monday, 1 April 2019
DynamoDb connection on localhost machine
https://medium.com/@vschroeder/install-a-local-dynamodb-development-database-on-your-machine-82dc38d59503
var AWS = require('aws-sdk');
var config = { "apiVersion": "2012-08-10", "accessKeyId": "abcde", "secretAccessKey": "abcde", "region":"us-west-2", "endpoint": "http://localhost:8000" } var dynamodb = new AWS.DynamoDB(config);
Subscribe to:
Posts (Atom)