Skip to content

Instantly share code, notes, and snippets.

@yuitest
yuitest / decode.rb
Last active August 29, 2015 14:14 — forked from nullkal/decode.rb
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'base64'
hexagrams = "䷀䷪䷍䷡䷈䷄䷙䷊䷉䷹䷥䷵䷼䷻䷨䷒䷌䷰䷝䷶䷤䷾䷕䷣䷘䷐䷔䷲䷩䷂䷚䷗䷫䷛䷱䷟䷸䷯䷑䷭䷅䷮䷿䷧䷺䷜䷃䷆䷠䷞䷷䷽䷴䷦䷳䷎䷋䷬䷢䷏䷓䷇䷖䷁"
base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
puts Base64.decode64(gets.tr(hexagrams, base64chars))
@yuitest
yuitest / jsonstreaming
Last active August 29, 2015 13:57 — forked from akaihola/.gitignore
forked from akaihola/.gitignore
https://gist.github.com/akaihola/1415730 をフォークした。
jsonstreaming は素敵だ。私は巨大な json を生成するときに活用させて頂いている。
数点、私の利用状況とそぐわない点があったので、そこだけ変更させて頂いた。
# 変更点
- 元となる import 先を simplejson ではなく組み込みの json モジュールとした。
そのため Django に依存しなくなった。(当然、ライセンスは元の Django Software Foundation and individual contributors. に従う )