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
{ | |
"overrides": [ | |
{ | |
"files": ".prettierrc", | |
"options": { "parser": "json" } | |
} | |
], | |
"quoteProps": "consistent", | |
"semi": false, | |
"singleQuote": true, |
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
<section class="rain"></section> |
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 long2tile(lon,zoom) { return ( | |
Math.floor((lon+180)/360*Math.pow(2,zoom))); } | |
function lat2tile(lat,zoom) { return ( | |
Math.floor((1-Math.log(Math.tan(lat*Math.PI/180) + 1/Math.cos(lat*Math.PI/180))/Math.PI)/2 *Math.pow(2,zoom))); } | |
console.log(long2tile(51.1,12)+' '+lat2tile(0.1,12) |
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
const spawn = require('cross-spawn'); | |
const path = require('path') | |
const ls = spawn.sync('npm', ['ls','--json']); | |
const tree = JSON.parse(ls.stdout) | |
const walkDepTree = (tree,cb) => { | |
const deps = tree.dependencies | |
if(deps) { |
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
require('dotenv').config(); | |
var OAuth = require('oauth'); | |
var request = new OAuth.OAuth( | |
null, | |
null, | |
process.env.MY_YAHOO_API_KEY, | |
process.env.MY_YAHOO_API_SECRET, | |
'1.0', |
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
// require('secrets'); | |
var OAuth = require('oauth'); | |
var request = new OAuth.OAuth( | |
null, | |
null, | |
MyKey, | |
MySecret, | |
'1.0', |
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
rsync -cav --no-o --no-g srcdir1 srcdir2 remoteuser@remotehost:/var/www/html |
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
# dd status=progress if=linux-lite-3.8-32bit.iso of=/dev/sdb bs=4M |
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 | |
// SETUP PHP ARRAY USING HARDCODED JSON INSTEAD OF HARDCODED PHP | |
include 'q.php'; | |
// ACTUAL ASSOC ARRAY TO XML & JSON SERIALISATION STARTS HERE | |
function aatoxml($xml,$ele) { | |
if (is_array($ele)) { |
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
mysqldump tables into separate files | |
assuming user and pass are defined in .my.cnf | |
$ mysqldump -h myhost --skip-lock-tables --compact --extended-insert --max_allowed_packet=64M --tab=dir_name |