Skip to content

Instantly share code, notes, and snippets.

@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
@makamaka
makamaka / gist:1161799
Created August 22, 2011 06:36
YAPC::Asia Tokyo 2011 上司の説得が必要な方へ

この文章は http://www.adobe.com/jp/joc/max2011/cyb/index.html (Adobe MAX 2011 : 上司の説得が必要な方へ)一般向けテンプレートが元ネタです。ネタを活かしきれていないですがご容赦を。(下記テンプレの文責はmakamakaに帰しますが、実際に使用した結果の責任は負いかねます)

#上司の説得が必要な方へ

「YAPC::Asia Tokyo 2011に参加したいが、上司が首を縦に激しく振ってくれない」という方のために、YAPC::Asiaに参加するメリットをアピールするための文章テンプレートを用意しました。ぜひ、カスタマイズしてご利用ください。っていうか、そのまま使うのはおやめください。

@jwo
jwo / registrations_controller.rb
Created September 30, 2011 23:11
API JSON authentication with Devise
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201
return
else

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@miyukki
miyukki / ZeroFix.user.js
Created May 2, 2012 08:48
ZeroFix is ZeroWatch of niconico fixer. ZeroWatchが改良するまでの暫定的なユーザースクリプトです。 タイトルの縮小、タグの複数段表示、市場エリアを投稿者情報に、コメント入力エリアを下に、フェードを無効化などの機能があります。
// ==UserScript==
// @name ZeroFix
// @namespace applest.net
// @version 0.9
// @description ZeroFix is ZeroWatch of niconico fixer. ZeroWatchが改良するまでの暫定的なユーザースクリプトです。 タイトルの縮小、タグの複数段表示、市場エリアを投稿者情報に、コメント入力エリアを下に、フェードを無効化などの機能があります。
// @include http://www.nicovideo.jp/watch/*
// @license MIT License(http://en.wikipedia.org/wiki/MIT_License)
// ==/UserScript==
/*********************************************
@rummelonp
rummelonp / faraday.md
Last active May 20, 2022 12:23
Ruby の HTTP クライアントライブラリ Faraday が便利そう

Ruby の HTTP クライアントライブラリ Faraday が便利そう

Ruby の HTTP クライアントライブラリ Faraday が便利そう

API ラッパの開発には [RestClient gem][rest_client_gem] だとか
OAuth の必要なものは [Net/HTTP][net_http] + [OAuth gem][oauth_gem] を使ってた

[Twitter gem][twitter_gem] や [Instagram gem][instagram_gem] など API ライブラリのソースを読んでみると
[Faraday gem][faraday_gem] というものがよく使われてた

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 23, 2024 18:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@sorah
sorah / kget_noflash.user.js
Created July 14, 2012 00:58
userscript for kget.jp: remove flash, and javascript will retrieve lyric for you; own your risk
// ==UserScript==
// @name kget_noflash
// @namespace http://sorah.jp/
// @description remove flash, and javascript will retrieve lyric for you; own your risk
// @include http://lyric.kget.jp/*
// ==/UserScript==
// License: Public Domain
window.addEventListener("load", function() {
@UniIsland
UniIsland / SimpleHTTPServerWithUpload.py
Created August 14, 2012 04:01
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@zonuexe
zonuexe / 101.rb
Created October 16, 2012 07:51
101
# -*- coding: utf-8 -*-
#
# author: USAMI Kenta <tadsan@zonu.me>
# license: NYSL 0.9982
#
puts %w(
字佐美健太
-忠吉さん,_tadsan
--Zonu.EXE