Skip to content

Instantly share code, notes, and snippets.

View linyows's full-sized avatar

Tomohisa Oda linyows

View GitHub Profile
@justincase
justincase / gist:5469009
Created April 26, 2013 17:45
Print struct with field names and values. From http://blog.golang.org/2011/09/laws-of-reflection.html
type T struct {
A int
B string
}
t := T{23, "skidoo"}
s := reflect.ValueOf(&t).Elem()
typeOfT := s.Type()
for i := 0; i < s.NumField(); i++ {
@mala
mala / gist:5062931
Last active March 18, 2020 15:31
TwitterのOAuthの問題まとめ

どういう問題があったか

説明するのめんどい http://vividcode.hatenablog.com/entry/twitter-oauth-vulnerability

どういう対策がされたか

とりあえず即座に攻撃できるような状態ではなくなっています。

フィッシング?

@mala
mala / safari-like-cookie-policy-is-too-bad.md
Last active July 11, 2019 05:36
Firefox 22のCookieに関するポリシー変更(予定)についての意見書
@kyanny
kyanny / gist:5010650
Last active December 14, 2015 01:59
msgpack/msgpack#121を3行でまとめるブログ

まともなまとめがあったのでそちらをご覧ください

MessagePackが文字列とバイナリをわけないのは問題?
https://gist.github.com/repeatedly/5011298

  • おい!おれの Python/ObjC なコードで msgpack 使うとなんかデータを復元できないんですが?バイト列か文字列か不明な場合が考慮されてないのが原因なんだから UTF-8 な文字列型を仕様に盛り込んでください
  • いやそれ特定の言語でしか起こらない問題だしプロトコル仕様はミニマムであるべきだよね?でも折衷案として文字列型を新しく定義する代わりに型ヒントを表すバイトを付与できるようにしたらどうかな?
  • JSON-like を謳うなら JSON と同じようにしろとか IETF に仕様を提案したらどうかとかオレが言いたいのはそういうことじゃねーよ文化の違いだ黙れジャップどもとか大いにモメた後、主要な開発者陣が具体的な仕様を議論し始めるも引き続き外野が水掛け論で延焼中(イマココ
@aereal
aereal / config_application.rb
Last active December 12, 2015 09:19
Rails example to log session as LTSV (Labeled Tab-separated Values)
class Application < Rails::Application
config.middleware.use LtsvRequestLogger
end
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 1, 2025 01:48
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@utahta
utahta / nginx.conf
Created January 6, 2013 11:01
nginx + php-fpm + reverse proxy
user nginx;
worker_processes 2;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@ndarville
ndarville / business-models.md
Last active February 27, 2025 10:00
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@yoshihiro503
yoshihiro503 / trans_pukiwiki_fnames.ml
Created December 10, 2012 07:27
pukiwikiのwikiデータのファイル名を読みやすい構造に変換する ref: http://qiita.com/items/25d3ac45603ae1090254
(*
pukiwikiの内部データのファイル名を可読できる名前に変換する
ls /PUKIWIKIDIR/wiki/*.txt | ocaml trans_pukiwiki_fnames.ml
*)
let outdir = "out/"
let verbose = true
let (|>) x f = f x
let (@@) f x = f x
let (!%) = Printf.sprintf
@rummelonp
rummelonp / percol_zsh.md
Created December 7, 2012 15:57
percol 入れて zsh と組み合わせたら超便利

percol 入れて zsh と組み合わせたら超便利

だったので紹介

percol とは

percol は入力の1行を1候補として,部分一致かつ AND 検索で絞り込みし,選択した候補を出力するコマンドです.端的に言えば Emacs の anything.el のコマンド版です.