Skip to content

Instantly share code, notes, and snippets.

View beatak's full-sized avatar
🍄
Mushroom

Takashi M beatak

🍄
Mushroom
  • San Francisco, CA
View GitHub Profile
ERROR
Value is not a sequence
FILE
https://www.icloud.com/
LINE
12
EXCEPTION INFO
@beatak
beatak / tablesorter.js
Created August 20, 2017 16:26
just sorting
var tablesorter = function(table) {
var data = [],
header = {},
header_tr,
$table = $(table),
is_asc = false,
$indicator = $('<span></span>');
$table.find('th').each(function(i, th) {
var $th = $(th);
Array.prototype.shuffle = function () {
var m = this.length, t, i;
while (m) {
i = Math.floor(Math.random() * m--);
t = this[m];
this[m] = this[i];
this[i] = t;
}
return this;
};
var existsSyncWrap = function (mypath) {
if (typeof fs.existsSync === 'function') {
return fs.existsSync(mypath);
}
else {
try {
fs.accessSync(mypath, fs.constants.F_OK);
}
catch (er) {
return false;
function strMapToObj(strMap) {
var obj = Object.create(null);
strMap.forEach(function(val, key) {
console.log('strMapToObj: ' + key + ' -> ' + val);
obj[key] = val;
});
return obj;
}
function objToStrMap(obj) {
var strMap = new Map();
diff --git a/node_modules/requirejs/bin/r.js b/node_modules/requirejs/bin/r.js
index 17c101b..6f088bb 100755
--- a/node_modules/requirejs/bin/r.js
+++ b/node_modules/requirejs/bin/r.js
@@ -19951,6 +19951,7 @@ function Compressor(options, false_by_default) {
warnings : true,
global_defs : {}
}, true);
+console.log('Compressor const: ' + JSON.stringify([options, this.options]));
};
<?php
class Address_Formatter_DataGenerator {
const SHORT_OPTS = ['a', 'p', 'c', 'j', 'h', 'x', 'g',];
public static function getShortOpts() {
return implode('', self::SHORT_OPTS);
}
public static function processArguments() {
var fs = require('fs');
var path = require('path');
var shell = require('shelljs');
var options = require('optimist');
var ETSYWEB_DIR = path.join(process.env.HOME, 'development', 'Etsyweb');
var DEPSY_PATH = 'bin/fei/depsy/bin/depsy.js';
var JS_BASE_PATH = 'htdocs/assets/js/';
var global_start, global_end;
% powershell
PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
zsh: segmentation fault powershell
@beatak
beatak / convertMapToObj.js
Created August 5, 2016 22:06
ES6 Map object serialize
var convertMapToObj = function (myMap) {
var obj = {};
myMap.forEach(function (value, key) {
obj[key] = value;
});
return obj;
};