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
# ${original.pkg} => the original name of .pkg file | |
pkgutil --expand ${original.pkg} expanded.pkg | |
# to find what Bom files you got | |
find gviz.pkg -name 'Bom' | |
# to show the files and directories | |
find gviz.pkg -name 'Bom' | xargs -I{} lsbom {} | |
# lsbom exports "tab delimited file". And also it's on relative path. |
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 shyiezeRecur = function () { | |
var $div = $('#something'); | |
var MAX_CHAR = 55; | |
$div.data('shyed'); | |
var w = $div.width(); | |
$div.find('*').each( | |
function () { | |
var $this = $(this); | |
if ($this.find('*').length === 0 && $this.width() > w) { | |
$this.shyize({limit: MAX_CHAR}); |
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 getRoundupValue = function (val, table) { | |
var result; | |
if (val <= table[0]) { | |
result = table[0]; | |
} | |
else if (val >= table[table.length - 1]) { | |
result = table[table.length - 1]; | |
} | |
else { | |
var v1, v0, d0, d1; |
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
// http://stackoverflow.com/questions/962802/is-it-correct-to-use-javascript-array-sort-method-for-shuffling | |
Array.prototype.shuffle = function () { | |
var tmp, current, top = this.length; | |
if (top) { | |
while(--top) { | |
current = Math.floor(Math.random() * (top + 1)); | |
tmp = this[current]; | |
this[current] = this[top]; | |
this[top] = tmp; |
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 () { | |
var _mobile; | |
window.isMobile = function () { | |
if (!_mobile) { | |
var ua = navigator.userAgent; | |
_mobile = { | |
a: ua.match(/Android/i) ? true : false, | |
bb: ua.match(/BlackBerry/i) ? true : false, | |
ios: ua.match(/iPhone|iPad|iPod/i) ? true : false, | |
win: ua.match(/IEMobile/i) ? true : false |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
#menu { | |
background-repeat: no-repeat; | |
background-position: center center; | |
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOcAAAHzCAYAAADbxAoZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAuTSURBVHic7d0/cxz1Hcfx715ofR1NfE9AVyQzKWIXMKbAPIG4sKEJFCZujAoIRSaZDCQFA4WBgkAh3HjswtB47EJqGMIMcnpO6ZJMTulZHsCmkPxH0lm6k066D/j1qkA+7e3t6X372z+323Rd19UCjcfj2hyP933M0nBY/X7/2Obh/vr6sU17Efr9fi0Nh8f+PG3b1sZodOzPc1yO/r43VdVN+O/pXF/5vJaGw7px6+bkqe+Os23b+vjah7W+vl4bo9Gh3+jZX/j0L67bfvRRpjn9NPabfFO157Otqa66o0/7ic8z+x9Bntlfw4P3a+L7NvF9OC7zX/5Xl9+oq8vLe59pd5xrq6t15fLrc33y/S36j23Rz3+cdr62/T+QDlgOBwQwaXRzmA/AjdGo2rad8bd2OuwH7+Mff0f+u5jyA2NpOKzN8bhu3Lq5ZyX4zO4Hf3n7i6qqevW11+pU/1RVNbU0XNqx4KdZKz55AR3uRZ8eDGowGMz8ez91Z86eXfQscESfr6zU7998q27curmjsz1rzrfffKuqqt774P2TnUN4il25/HoNBoP6w5/++PBnD9ecbdvWF7dv19rqar33wfvVtu2BO2HmuSPlpHZiQKL3Pni/Xnju+XrxpfMPR0MP15zj8bheeO75KSYz67B0Dtt0h9zgn/fQ+sl2T+/g6e+3XbT1b4 |
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 obj = { | |
onBodyClick: function (ev) { | |
console.log('onBodyClick'); | |
$(document).triggerHandler('onBodyClick', [this]); | |
} | |
}; | |
$(document.body).on('click', obj.onBodyClick); |
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
#!/usr/local/bin/node | |
var parse = require('esprima').parse; | |
var generate = require('escodegen').generate; | |
// MULTI ARGS ==================================== | |
var code = "console.log('a', 'b', 'c');"; | |
console.log(code); | |
console.log( '====' ); | |
var ast = parse(code); |
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
#!/usr/local/bin/node | |
var parse = require('esprima').parse; | |
var generate = require('escodegen').generate; | |
var codes = [ | |
"console.log('a', 'b', 'c');", | |
"console.log('a');", | |
"console.log();" | |
]; |
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
#!/usr/bin/env node | |
var cli = require('cli'); | |
var options = cli.parse({ | |
boola: ['b', 'testing boolean value', 'bool', true] | |
}); | |
console.log(options); |