#Stay Standalone
A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.
#Stay Standalone
A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.
var data = "do shash'owania"; | |
var crypto = require('crypto'); | |
crypto.createHash('md5').update(data).digest("hex"); |
This re-styles your sublime text sidebar to be dark, it fits default Monokai theme.
Save the Default.sublime-theme file into packages/Theme - Default, make a backup of your original if you want to be able to go back easily.
Based on:
// Add the following to your preferences file | |
"folder_exclude_patterns":[".git","node_modules"] |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
var cl,ce,cw; | |
if(window.console && console.log){ | |
cl = console.log; | |
console.log = function(){ | |
MyLogFunction(arguments); | |
cl.apply(this, arguments) | |
} | |
} |
//equivalent of MySQL SELECT COUNT(*) AS cnt, fieldName FROM someTable GROUP BY fieldName; | |
db.someCollection.aggregate([{"$group" : {_id:"$fieldName", cnt:{$sum:1}}}]); | |
//as above but ordered by the count descending | |
//eg: SELECT COUNT(*) AS cnt, fieldName FROM someTable GROUP BY fieldName ORDER BY cnt DESC; | |
db.someCollection.aggregate([{"$group" : {_id:"$fieldName", cnt:{$sum:1}}}, {$sort:{'cnt':-1}}]); |
const logger = require('./logger'), | |
AWS = require('aws-sdk'), | |
CronJob = require('cron').CronJob; | |
AWS.config.update({region: 'us-east-1'}); // change to your region | |
var opts = { | |
credentials: new AWS.EC2MetadataCredentials()// default to use the credentials for the ec2 instance | |
}; | |
var elasticbeanstalk = new AWS.ElasticBeanstalk(opts); |
[ | |
{ code: 'AD', label: 'Andorra', phone: '376', phoneLength: 6}, | |
{ code: 'AE', label: 'United Arab Emirates', phone: '971', phoneLength: 9}, | |
{ code: 'AF', label: 'Afghanistan', phone: '93', phoneLength: 9}, | |
{ code: 'AG', label: 'Antigua and Barbuda', phone: '1-268', phoneLength: 10}, | |
{ code: 'AI', label: 'Anguilla', phone: '1-264', phoneLength: 10}, | |
{ code: 'AL', label: 'Albania', phone: '355', phoneLength: 9}, | |
{ code: 'AM', label: 'Armenia', phone: '374', phoneLength: 6}, | |
{ code: 'AO', label: 'Angola', phone: '244', phoneLength: 9}, | |
{ code: 'AQ', label: 'Antarctica', phone: '672', phoneLength: 6}, |