Skip to content

Instantly share code, notes, and snippets.

View tobynet's full-sized avatar

tobynet tobynet

  • Toyama, Japan
View GitHub Profile
@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] というものがよく使われてた

#!/bin/bash
COMPILE_JOBS=1
PREFIX="/app/vendor/phantomjs"
QT_CFG="-I$PREFIX/include -L$PREFIX/lib"
until [ -z "$1" ]; do
case $1 in
"--qt-config")
@stomita
stomita / build.sh
Last active October 5, 2015 00:38
#!/bin/bash
BUILDPACK_PREFIX=/app/vendor/phantomjs
PHANTOMJS_VERSION="1.9.1"
PHANTOMJS_DIR="phantomjs-${PHANTOMJS_VERSION}"
FONTCONFIG_VERSION="2.10.2"
FONTCONFIG_DIR="fontconfig-${FONTCONFIG_VERSION}"
mkdir -p ${BUILDPACK_PREFIX}
curl -L "http://fontconfig.org/release/fontconfig-${FONTCONFIG_VERSION}.tar.gz" | tar zxf -
@melborne
melborne / Plugins.textile
Created May 9, 2012 11:54
Translation of Jekyll Plugins

https://github.com/mojombo/jekyll/wiki/Plugins

Jekyllプラグインシステムのフックは、あなたのサイト向けに特化したコンテンツの生成を可能にします。Jekyllのソースを修正することなく、あなたのサイト用のコードを実行できます。

The Jekyll plugin system hooks allow you to create custom generated content specific to your site. You can run custom code for your site without having to modify the Jekyll source itself.

プラグインのインストール

h2. Installing a plugin

@mandel59
mandel59 / emoticons.txt
Created May 6, 2012 06:15
絵文字辞書
にっこり ☺ 顔文字
さんた 🎅 顔文字
いるか 🐬 顔文字
ねずみ 🐭 顔文字
うし 🐮 顔文字
とら 🐯 顔文字
うさぎ 🐰 顔文字
ねこ 🐱 顔文字
たつ 🐲 顔文字
りゅう 🐲 顔文字
@liamcurry
liamcurry / gist:2597326
Created May 4, 2012 19:56
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@tily
tily / chef_solo_in_your_application.rb
Created April 30, 2012 06:17
自分のアプリケーションから Chef Solo を呼び出す
# Usage: ruby chef_solo_in_your_application.rb
require 'rubygems'
require 'chef'
Chef::Config[:solo] = true
Chef::Config[:file_cache_path] = '/path/to/chef-repo'
Chef::Config[:cookbook_path] = ['/path/to/chef-repo/cookbooks']
@chef_solo = Chef::Client.new(JSON.load File.read ARGV.first)
@chef_solo.run
@bokutin
bokutin / chohyo.pl
Created April 24, 2012 18:24
Strawerry Perlを使って帳票印刷をごまかす
use utf8;
use strict;
use feature ":5.10";
use Text::MicroTemplate;
use IO::All;
main: {
my $html_fn = 'chohyo.html';
my $pdf_fn = 'chohyo.pdf';
@royratcliffe
royratcliffe / ubuntu12.04-ruby1.9.1.erb
Created April 20, 2012 12:26
Chef bootstrap for Ubuntu Precise Pangolin (12.04) using Ruby 1.9
bash -c '
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>
(
cat <<'EOP'
gem: --bindir=/usr/bin --no-ri --no-rdoc
EOP
) > /tmp/gemrc
awk NF /tmp/gemrc > /etc/gemrc
rm /tmp/gemrc
@thbar
thbar / README.MD
Created April 18, 2012 09:43
Ruby JSON pipe pretty-printer

A quick ruby command line to pretty-print piped json.

Usage

Put this somewhere in your path, with chmod +x, then:

curl http://myapp.com/stuff.json | json