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
@beatak
beatak / -
Created November 1, 2014 03:44
This file has been truncated, but you can view the full file.
[ 'activity/_modules/buyer-onboarding.js: (wrap-iife) Move the invocation into the parens that contain the function. 1:0',
'activity/_modules/buyer-onboarding.js: (no-use-before-define) logEvent was used before it was defined 45:12',
'activity/_modules/buyer-onboarding.js: (no-use-before-define) init was used before it was defined 49:4',
'activity/_modules/buyer-onboarding.js: (no-use-before-define) showOnboardingOverlay was used before it was defined 60:70',
'activity/_modules/buyer-onboarding.js: (no-use-before-define) showOnboardingOverlay was used before it was defined 80:12',
'activity/_modules/buyer-onboarding.js: (no-use-before-define) logEvent was used before it was defined 85:8',
'activity/_modules/buyer-onboarding.js: (no-use-before-define) emptyAndHideTastemakers was used before it was defined 88:8',
'activity/_modules/buyer-onboarding.js: (no-use-before-define) showBucketsStep was used before it was defined 89:8',
'activity/_modules/buyer-onboarding.js: (no-use-before-define) setPr
@beatak
beatak / utility.patch
Last active August 29, 2015 14:07
merge and uniqify_array that I implemented. slow.
diff --git b/lib/utility.js a/lib/utility.js
new file mode 100644
index 0000000..91a03ff
--- /dev/null
+++ a/lib/utility.js
@@ -0,0 +1,72 @@
+/*jslint node: true */
+'use strict';
+
+var uniqify_array = function(arr) {
@namespace svg "http://www.w3.org/2000/svg";
@charset "UTF-8"; /* Set the encoding of the style sheet to Unicode UTF-8 */
@charset 'iso-8859-15'; /* Set the encoding of the style sheet to Latin-9 (Western European languages, with euro sign) */
a {
margin : auto;
padding : 0;
}
@beatak
beatak / get_all_css_test.js
Created August 29, 2014 23:58
https://github.com/reworkcss/css is an interesting project and `test` cases are full of interesting css rules | declarations… so I decided to take all css into one file! you need to put this file into their repo root to run it.
'use strict';
var fs = require('fs');
var path = require('path');
var shell = require('shelljs');
var CWD = path.resolve( process.cwd() );
var dir_test = path.join(CWD, 'test', 'cases');
var result = [];
$str = "あAいうえおaかAきくけこaさAしすせそ";
$pattern = "a";
mb_ereg_search_init($str, $pattern, "i");
while (mb_ereg_search()) {
print_r( [mb_ereg_search_getpos(), mb_ereg_search_getregs()] );
}

TEST test More examples of the d3.scale.cubehelix plugin, replicating four Python cubehelix examples. In the last two examples, a polylinear scale creates a diverging cubehelix color ramp, and an approximate recreation of Matteo Niccoli’s perceptual rainbow.

@beatak
beatak / random.el
Last active January 3, 2016 19:29
random things that I'm learning emacs lisp
http://www.gnu.org/software/emacs/manual/html_node/elisp/Displaying-Messages.html
(message-box "foobar")
;; to set alpha
(set-frame-parameter nil 'alpha '(100 100))
@beatak
beatak / exitter.py
Created January 4, 2014 01:01
understanding subprocess.Popen() and getting return code i always forget how it works…
#! /usr/bin/env python
import argparse
parser = argparse.ArgumentParser( description='w/e' )
parser.add_argument( '-code', type=int, help='exit code' )
args = parser.parse_args()
if args.code:
import Queue
import threading
import time
import os
import random
from logger import Logger
from config import Config
# input queue to be processed by many threads
q_in = Queue.Queue(maxsize=0)
#! /usr/bin/env python
import threading
global_var = { 'handler': None, 'sec_wait': 1.0 }
def cb_success ():
print( 'success!' )
def cb_cancel ():
if global_var['sec_wait'] >= 5.0: