This file contains hidden or 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
// iterate over a NamedNodeMap | |
Array.prototype.map.call(attributes, attr => `${attr.nodeName} = ${attr.nodeValue}` ) |
This file contains hidden or 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
object Sequence { | |
def main(args: Array[String]): Unit = { | |
val REFRESH = 100 | |
val ROCKET = "\uD83D\uDE80" | |
val EARTH = "\uD83C\uDF0E" | |
val BOOM = "\uD83D\uDD25" | |
val MAX_TICKS = 20 | |
while (true) { | |
var ticks = 0 |
This file contains hidden or 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 defaultToCurrentScreen true | |
config nudgePercentOf screenSize | |
config resizePercentOf screenSize | |
bind space:shift;cmd grid 0:3,1 |
This file contains hidden or 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 fs = require('fs'), | |
http = require('http'), | |
https = require('https'), | |
httpProxy = require('http-proxy'); | |
var options = { | |
https: { | |
key: fs.readFileSync('key.pem', 'utf8'), | |
cert: fs.readFileSync('cert.pem', 'utf8') | |
} |
This file contains hidden or 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
git log --oneline --decorate --all --graph |
This file contains hidden or 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
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else |
This file contains hidden or 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
set_prompt_style () { | |
local bldpur='\e[1;35m' # Purple | |
local bldblu='\e[1;34m' # Blue | |
local bldblk='\e[1;30m' # Black - Bold | |
local bldred='\e[1;31m' # Red | |
local txtrst='\e[0m' # Text Reset | |
# local bashuser="\[$bldpur\]\u@\[$txtrst\]" # username | |
local bashhost="\[$bldpur\]\h\[$txtrst\]" # hostname | |
local bashdir="\[$bldblu\]\w\[$txtrst\]" # directory | |
local bashprompt="\[$bldblk\]: \[$txtrst\]" # prompt symbol |
This file contains hidden or 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(window, document, Math, undef) { | |
var nop = function(){}; | |
var debug = (function() { | |
if ("console" in window) { | |
return function(msg) { | |
window.console.log('Processing.js: ' + msg); | |
}; |
This file contains hidden or 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 wrapper = document.createElement('div'); | |
var outer = document.getElementById('whatever') | |
var nodes = outer.childNodes; | |
var elementsWidth = 0; | |
for (var i = 0; i < nodes.length; i++) { | |
if (nodes[i].nodeType === Node.ELEMENT_NODE | |
&& nodes[i].tagName === 'IMG' | |
) { | |
elementsWidth += nodes[i].width; |
This file contains hidden or 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
// deobfuscated from http://assets.pinterest.com/js/pinmarklet.js using http://jsbeautifier.org/ | |
(function (k, m, n, l) { | |
var a = k[l.k] = { | |
w: k, | |
d: m, | |
n: n, | |
a: l, | |
s: {}, | |
f: function () { |