Skip to content

Instantly share code, notes, and snippets.

View Himenon's full-sized avatar
😇
Working from home

K.Himeno Himenon

😇
Working from home
View GitHub Profile
@KOBA789
KOBA789 / main.js
Created December 23, 2010 07:40
外部ファイルを動的ロードするサンプル
/*
* 外部ファイルを動的ロードするサンプル
*
* node.js だとコードを修正するたびにプロセス殺して、もう一度立ちあげなきゃならないから面倒だよね。
* 実行中書き換えとかできないの? ってなわけで作ってみた。
* PHP とか Perl って CGI だから実行の度にプロセスが走るわけで、
* コード修正したら F5 するだけで結果がわかるから超手軽なんだけど、
* それだとプロセス起動のコストが高いわけで、これはその辺のジレンマも解消してみた。
*
* コード見ればわかるんだけど外部ファイルが書き換えられた瞬間にスクリプトがコンパイルされる感じ。
@tetu1225
tetu1225 / app.rb
Created July 18, 2011 06:00
Sinatraで画像ファイルをアップロードして表示する
require 'sinatra'
require 'haml'
# 静的コンテンツ参照のためのパス設定
set :public, File.dirname(__FILE__) + '/public'
# アップロード
get '/' do
haml :index
@benatkin
benatkin / Global.sublime-settings
Created July 20, 2011 04:26
excluding node_modules from Sublime Text 2
// Place user-specific overrides in this file, to ensure they're preserved
// when upgrading
{
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "node_modules"]
}
@fairchild
fairchild / Gemfile
Created December 7, 2011 09:58
An example sinatra omniauth client app
source :rubygems
gem 'sinatra'
gem 'json'
gem 'omniauth'
gem 'omniauth-oauth2'
gem 'omniauth-github'
# gem 'omniauth-att', :path => File.expand_path("./../../omniauth-att", __FILE__)
gem 'thin'
@jboner
jboner / latency.txt
Last active July 28, 2024 07:48
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@Gab-km
Gab-km / github-flow.ja.md
Last active April 25, 2024 04:01 — forked from juno/github-flow.ja.md
GitHub Flow (Japanese translation)
@chrislkeller
chrislkeller / README.md
Last active December 16, 2022 15:25
Sync data across Google Spreadsheets

Snippets: Sync data across Google Spreadsheets

Added to a Google spreadsheet, this script will take data from a master spreadsheet and sync it to a working spreadsheet.

Variables to change are:

// source doc
var sss = SpreadsheetApp.openById('0An8....');

// source sheet

@uchida
uchida / Tweaks.rst
Last active January 1, 2021 04:35
Sphinx と LaTeX を使うときの 小技

Sphinx と LaTeX を使うときの 小技

著者:打田 旭宏
ライセンス:CC-BY 3.0
更新日時:|time|

Sphinx の LaTeX 出力を利用するときに見栄えを凝るのに知っておくとよいかもしれない小技をまとめました。

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active July 17, 2024 14:20
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: