This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// config/passport.js | |
// load all the things we need | |
var LocalStrategy = require('passport-local').Strategy; | |
var mysql = require('mysql'); | |
var connection = mysql.createConnection({ | |
host : 'localhost', | |
user : 'root', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<!-- phonegap plugin add org.apache.cordova.camera | |
phonegap plugin add org.apache.cordova.file-transfer | |
Copy JS Files from | |
--> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="format-detection" content="telephone=no" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery Required | |
// Creating / Opening DB | |
var db = window.openDatabase("techm", "1.0", "TechM Employees", 100000) | |
function createTable(table, fields,cb) { | |
db.transaction(function (tx) { | |
tx.executeSql('create table ' + table + fields, [], function () { | |
return cb("Table Created : " + table) | |
}, function () { | |
return cb("SQL Error") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// To Generate PEM file follow : http://stackoverflow.com/questions/21250510/generate-pem-file-used-to-setup-apple-push-notification | |
$deviceToken = '29954cd9ace7a7c29f66918e62e8a18522619c5cabae08972da6cd4273fe874c'; | |
$passphrase = 'apns'; | |
$message = 'test'; | |
$ctx = stream_context_create(); | |
stream_context_set_option($ctx, 'ssl', 'local_cert', 'pushcert.pem'); | |
stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase); | |
$fp = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var soapAction = " http://server.test.nam/RequestHandler/reverseYourName " | |
var soapRequestBody = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://server.test.nam"> <soapenv:Header/> <soapenv:Body> <ser:reverseYourName> <ser:name>test</ser:name> </ser:reverseYourName> </soapenv:Body> </soapenv:Envelope>' | |
$.ajax({ | |
url: "http://10.23.249.55:8282/WebServiceForServer/services/RequestHandler", | |
type: "POST", | |
data: soapRequestBody, | |
beforeSend: function(xhr) { | |
xhr.setRequestHeader("SOAPAction", soapAction) | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db = window.openDatabase("Demo", "1.0", "BusinessApp", 200000); | |
insertIndex = 0; | |
var insertCounter = 0; | |
insertBatch = function(array, arrayLength, tableName, fieldQuestions, cb) { | |
console.log("Inserting Record :" + insertCounter); | |
if (insertIndex < arrayLength) { | |
db.transaction(function(tx) { | |
var sql = 'INSERT OR IGNORE INTO ' + tableName + ' VALUES ' + fieldQuestions; | |
console.log("sql: " + sql); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Multiples INSERTs : 2500ms | |
// Using BEGIN and COMMIT : 90ms | |
// Using SELECT and UNION : 40ms | |
var newQuery = true, query = ''; | |
for (i=0; i<locations_length; i++) { | |
if (newQuery) { | |
query = 'INSERT INTO myTable (id, name, code)'; | |
newQuery = false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$deviceToken = '6e1326c0e4758b54332fab3b3cb2f9ed92e2cd332e9ba8182f49027054b64d29'; // iPad 5s Gold prod | |
$passphrase = ''; | |
$message = 'Hello Push Notification'; | |
$ctx = stream_context_create(); | |
stream_context_set_option($ctx, 'ssl', 'local_cert', 'pushcert.pem'); // Pem file to generated // openssl pkcs12 -in pushcert.p12 -out pushcert.pem -nodes -clcerts // .p12 private key generated from Apple Developer Account | |
stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase); | |
$fp = stream_socket_client('ssl://gateway.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx); // production | |
// $fp = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx); // developement |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function evaluate(x) { | |
xp = x.split(";") | |
console.log(xp) | |
xp.forEach(function (item, index) { | |
console.log(index) | |
if (index != 0) { | |
eval(item) | |
} | |
if (index == (xp.length - 1)) { | |
var ss = (("(" + xp[0]).replace(/(\+|-)/g, ")+(") + ")").replace(/([0-9]+)([a-z]{1})/g, "$1*$2") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Starting copy from repository to work tree..." | |
git --work-tree=/d/push-to-deploy/production checkout -f master | |
echo "Finished." | |
exit 0 |
OlderNewer