Skip to content

Instantly share code, notes, and snippets.

View matsuda's full-sized avatar

Kosuke Matsuda matsuda

  • Tokyo, Japan
View GitHub Profile
@kwatch
kwatch / gist:2814940
Created May 27, 2012 16:18
Rubyの特殊変数一覧
$! raise された例外オブジェクト
$" require で読み込まれたファイルの配列
$#
$$ 現在のプロセス ID
$%
$& 正規表現にマッチした箇所の文字列
$' 正規表現にマッチした箇所より後ろの文字列
$(
$)
$* Ruby スクリプトに指定された引数。ARGV と同じ
@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] というものがよく使われてた

@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@pheuter
pheuter / sc-dl.js
Created March 5, 2012 20:44
Bookmarklet that generates download link for a Soundcloud upload
(function(d) {
var dl = d.createElement('a');
dl.innerText = 'Download MP3';
dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1];
dl.download = d.querySelector('em').innerText+".mp3";
d.querySelector('.primary').appendChild(dl);
dl.style.marginLeft = '10px';
dl.style.color = 'red';
dl.style.fontWeight = 700;
})(document);
@jacobbubu
jacobbubu / ioslocaleidentifiers.csv
Created February 15, 2012 14:41
iOS Locale Identifiers
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@cockscomb
cockscomb / ios_japanese_documents_downloader.rb
Last active September 30, 2015 15:37
iOS Developer Library の日本語ドキュメント PDF を一括ダウンロードする Ruby スクリプト。Ruby 1.9.x 対応。
#! /usr/bin/env ruby
# encoding: UTF-8
require 'uri'
require 'json'
require 'open-uri'
require 'openssl'
require 'nokogiri'
def get_documents_info()
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@soemarko
soemarko / theme.html
Created November 26, 2011 16:18
embed github gist to tumblr
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->
@func09
func09 / git-diff-zip.sh
Created October 29, 2011 06:24
Gitで特定のコミットからの差分ファイルだけ抜き出してZipにする
git archive --format=zip --prefix=projectname/ HEAD `git diff --name-only <commit>` -o archive.zip
@uasi
uasi / Localizable.strings
Created October 9, 2011 08:19
Alternative Japanese localization for Growl 1.3.1
/* No comment provided by engineer. */
"Alert! Enabling this option will add Growl.app to your login items" = "注意!このオプションをオンにすると Growl がログイン項目に追加されます";
/* No comment provided by engineer. */
"Allowing this will let Growl launch everytime you login, so that it is available for applications which use it at all times" = "ログイン時に Growl を起動し、すべてのアプリケーションから使えるようにする";
/* No comment provided by engineer. */
"Application: %@\nTitle: %@\nDescription: %@\nClick to open the log" = "アプリケーション: %1$@\nタイトル: %2$@\n説明: %3$@\nクリックしてログを開く";
/* No comment provided by engineer. */