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 toISOString(date) { | |
function pad(n) { | |
return n < 10 ? '0' + n : String(n); | |
} | |
return date.getFullYear() + | |
'-' + pad(date.getMonth() + 1) + | |
'-' + pad(date.getDate()) + | |
'T' + pad(date.getHours()) + | |
':' + pad(date.getMinutes()) + | |
':' + pad(date.getSeconds()) + |
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 merge() { | |
function _merge(list) { | |
const obj = {}; | |
for (const item of list) { | |
for (const i in item) { | |
obj[i] = item[i]; | |
} | |
} | |
return obj; | |
} |
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 merge() { | |
function _merge(list) { | |
const obj = {}; | |
for (const item of list) { | |
for (const i in item) { | |
obj[i] = item[i]; | |
} | |
} | |
return obj; | |
} |
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
'use strict'; | |
const fs = require('fs'); | |
const stream = require('stream'); | |
class TailStream extends stream.Readable { | |
/** | |
* TailStream | |
* |
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
'use strict'; | |
const path = require('path'); | |
const fs = require('fs'); | |
const PNGReader = require('png.js'); | |
function thumb(file, width, bits, callback) { | |
fs.readFile(file, function (err, bytes) { |
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
'use strict'; | |
const path = require('path'); | |
const fs = require('fs'); | |
const PNGReader = require('png.js'); | |
function thumb(file, width, bits, callback) { | |
fs.readFile(file, function (err, bytes) { |
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
iptables -t nat -A PREROUTING -p tcp --dport 22 -j DNAT --to XX.XX.XX.XX:22 | |
iptables -A FORWARD -p tcp -d XX.XX.XX.XX --dport 22 -j ACCEPT | |
iptables -t nat -A POSTROUTING -j MASQUERADE |
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 (global, fullName, sortName) { | |
function Selector(q) { | |
if (q instanceof Selector) return q; | |
if (!(this instanceof Selector)) return new Selector(q); | |
var list; | |
if (typeof q === 'string') { | |
list = document.querySelectorAll(q); | |
Selector.from(list, this); | |
} else if (q instanceof Element) { |
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 fuck1 () { | |
function readdir (dir) { | |
return ['a', 'b', 'c', 'd', 'e'].map(function (n) { | |
return dir + n; | |
}).filter(function (n) { | |
return n; | |
}); | |
} | |
function addTo (obj, list) { | |
list.forEach(function (n) { |
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
// _ooOoo_ | |
// o8888888o | |
// 88" . "88 | |
// (| -_- |) | |
// O\ = /O | |
// ____/`---'\____ | |
// . ' \\| |// `. | |
// / \\||| : |||// \ | |
// / _||||| -:- |||||- \ | |
// | | \\\ - /// | | |