Skip to content

Instantly share code, notes, and snippets.

@hden
hden / keybase.md
Created May 27, 2015 03:55
keybase.md

Keybase proof

I hereby claim:

  • I am hden on github.
  • I am hden (https://keybase.io/hden) on keybase.
  • I have a public key whose fingerprint is 7D2C 39D1 7A70 09F3 71F8 287E 6C9F AF13 14EB 690A

To claim this, I am signing this object:

@hden
hden / fib.sql
Created May 13, 2015 04:45
Fibonacci numbers with SQLite
-- http://www.sqlite.org/lang_with.html --
WITH RECURSIVE
fib(current, next) AS (
SELECT 0 current, 1 next
UNION ALL
SELECT fib.next current, fib.current + fib.next next
FROM fib
LIMIT 20
)
SELECT current FROM fib
@hden
hden / index.html
Created January 20, 2015 04:41
Netflix-style title generator
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.11.0/css/semantic.min.css">
<style>
body {
font-family: "Helvetica Neue", Helvetica, sans-serif;
margin: 30px auto;
width: 1440px;
position: relative;
@hden
hden / index.html
Created January 13, 2015 07:06
title generator
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.11.0/css/semantic.min.css">
<style>
body {
font-family: "Helvetica Neue", Helvetica, sans-serif;
margin: 30px auto;
width: 1440px;
position: relative;
@hden
hden / data.tsv
Last active August 29, 2015 14:12
We can't make this file beautiful and searchable because it's too large.
"type" "yrmo" "restaurant_id" "name" "lat" "lng" "value"
"A" "2014-01" 42 "十二廚自助餐廳 - 台北喜來登大飯店" 25.0449723 121.522054 316850
"A" "2014-01" 189 "共同市場 - 大億麗緻酒店" 22.988004 120.197872 3155
"A" "2014-01" 228 "巴賽麗廳 - 台北亞都麗緻大飯店" 25.0627507 121.5297614 975
"A" "2014-01" 231 "頂餐廳 - Hotel ONE台中亞緻大飯店" 24.1499386 120.6651744 12443
"A" "2014-01" 472 "櫻の田野養生野菜鍋" 25.0510776 121.5681535 1500
"A" "2014-01" 574 "台北寒舍艾美酒店 - 探索廚房" 25.0385328 121.5681498 2335
"A" "2014-01" 579 "京華煙雲" 24.135064 120.663209 7000
"A" "2014-01" 580 "新月梧桐上海主題餐廳" 24.1335215 120.6631454 12000
"A" "2014-01" 581 "吉凡尼的花園" 24.135274 120.6625463 2100
@hden
hden / index.coffee
Created September 25, 2014 04:22
minimun event-driven email
'use strict'
debug = require('debug')('quest:project-name')
mandrill = require 'mandrill-api/mandrill'
r = require 'rethinkdb'
unit = require 'unt'
mandrill_client = new mandrill.Mandrill('mandrill-key')
app = unit.application()

Fair Dispatch Pattern for Node.js Stream

One-to-many stream propogation inspired by nsqio/nsq#307 (comment)

'use strict'

{Transform} = require 'stream'

class Mux extends Transform
@hden
hden / Cakefile
Created January 29, 2014 04:44
HuffPost-style Title Generator
'use strict'
_ = require 'underscore'
class TitleGenerator
n: =>
'' + _.random(1, 10) + '間'
getTitle: =>
n = do @n
@hden
hden / bookmarklet.js
Created December 18, 2013 13:15
Github Bookmarklet
javascript:(function() {var e = document.getElementById('pull_request_body');if (e) {e.value += '# What? Why?\n\n\n# How was it tested?\n\n\ncc CD team @';}})();
@hden
hden / br.csv
Created December 10, 2013 02:04
Treemap
did name q12 q34
768 漢來海港餐廳(巨蛋店-巨蛋會館5樓) 11.151650829973422 10.874212934830874
42 十二廚自助餐廳 - 台北喜來登大飯店 10.047123912114026 10.32755264408124
1317 上閤屋 JOGOYA - 台北南京店 10.926295994781112 10.149747119504683
1316 上閤屋 JOGOYA - 台中復興店 10.045759661382684 10.056637715113201
604 雲軒西餐廳 La Rotisserie - 君品酒店 9.46352437327118 10.053925881531105
654 Lawry's 勞瑞斯牛肋排餐廳 9.823367240046236 10.036173612553485
1415 潮港城-太陽百匯 9.142107057302551 9.791162888555018
652 Diamond Tony's 101 隨意鳥地方高空觀景餐廳 9.398743691938193 9.428360172704291
1718 這一鍋皇室祕藏鍋物(中山北店) 1 9.422064766172813