Skip to content

Instantly share code, notes, and snippets.

@trey
trey / reset.sass
Created July 31, 2008 20:36
Eric Meyer's reset.css in Sass. Originally by @postpostmodern.
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain) */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
@chooh
chooh / config.ru
Created December 28, 2010 15:48
Simple Rack web server for static files with index.html
# This is the root of our app
@root = File.expand_path(File.join(File.dirname(__FILE__), "www"))
run Proc.new { |env|
# Extract the requested path from the request
req = Rack::Request.new(env)
index_file = File.join(@root, req.path_info, "index.html")
if File.exists?(index_file)
# Rewrite to index
@nov
nov / token_request_sample.rb
Created March 23, 2011 17:29
Rack::OAuth2::Client Sample - Token Request
require 'rubygems'
require 'rack/oauth2'
client = Rack::OAuth2::Client.new(
:identifier => YOUR_CLIENT_ID,
:secret => YOUR_CLIENT_SECRET,
:redirect_uri => YOUR_REDIRECT_URI, # only required for grant_type = :code
:host => 'rack-oauth2-sample.heroku.com'
)
@makoto
makoto / real_world_druby.md
Created November 19, 2011 15:13 — forked from seki/real_world_druby.md
実世界でのdRubyの使用例

実世界でのdRubyの使用例

dRubyはこれまでに多くの大規模システムの基盤として利用されてきました。dRubyはいつものRubyプログラミングに非常に近い感覚で分散オブジェクトを実現します。これにより、複雑な分散システムであってもアイデアをすぐに実現することができます。 dRubyが提供するのは汎用のRMIです。スケッチの段階でdRubyを用い、有用性を確認したのちに用途に特化したミドルウェアに置き換えるといったように成長していったシステムも多いようです。 以下に実世界でのdRubyの使用例を示します。

Hatena Screen Shot (http://www.hatena.ne.jp/)

Hatena は日本を代表するインターネットカンパニーで、ブログ、ソーシャルブックマークサービスなどを提供しています。2006年当時(現在はサービス終了) Hatena Screen Shotという、登録されたURLのスクリーンショットをサムネイルとして表示するサービスがありました。このサービスのアーキテクチャーのユニークな点にWebフロントエンドはLinux上に構築されているが、スクリーンショットの撮影はWindowsのIEコンポーネントを用いて実現されていることにある。これはWindows環境の方がスクリーンショットを撮影できる環境が整っていたためであるが、クロスプラットフォーム間のシステムを協調させるdRubyを使った良い例といえよう。またスクリーンショットマシーンは並列処理が行われていたため、スケーラビリティも確保されていた。

@abahgat
abahgat / gae-memcache-decorator.py
Last active January 22, 2021 00:43
A Python decorator to cache method results using memcache on Google AppEngine
import functools
import logging
from google.appengine.api import memcache
def cached(time=1200):
"""
Decorator that caches the result of a method for the specified time in seconds.
Use it as:
@yegle
yegle / bash-invocation.md
Created January 5, 2012 11:44
Bash Shell启动方式与RC脚本

Bash Shell启动方式与rc脚本

Shell的不同分类

根据启动Bash Shell的方式不同,对Shell有两种分类方式

登录Shell与非登录Shell

根据Shell的启动方式不同,可以将Shell分为

@mdjhny
mdjhny / bash-invocation.md
Created January 6, 2012 12:35 — forked from yegle/bash-invocation.md
Bash Shell启动方式与RC脚本

Bash Shell启动方式与rc脚本

Shell的不同分类

根据启动Bash Shell的方式不同,对Shell有两种分类方式

登录Shell与非登录Shell

根据Shell的启动方式不同,可以将Shell分为

@jrochkind
jrochkind / gist:2161449
Created March 22, 2012 18:40
A Capistrano Rails Guide

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

anonymous
anonymous / stdin.txt
Created June 7, 2012 05:51
stdin
commit ba8c7a7a629b736fdc1abceaa3ec49f8820aec08
Author: Richard Yao <ryao@cs.stonybrook.edu>
Date: Thu Jun 7 01:44:31 2012 -0400
scsi: lpfc_scsi: Remove unused variables
Kernels built with CONFIG_SCSI_LPFC fail to compile due to the use of
-Werror=unused-variable. We solve that by removing some unused
variables.
@dseg
dseg / PKGBUILD for librabbitmq-c
Created November 23, 2012 05:07
librabbitmq-c 20121123-1
# Contributor: aleiphoenix <aleiphoenix@gmail.com>
pkgname=librabbitmq-c
pkgver=20121123
pkgrel=1
pkgdesc="A RabbitMQ(amqp) library written in C-language"
arch=('i686' 'x86_64')
license=('BSD')
makedepends=('git' 'autoconf' 'python' 'xmlto')
url=https://github.com/alanxz/rabbitmq-c