Skip to content

Instantly share code, notes, and snippets.

@jugyo
jugyo / gist:4071551
Created November 14, 2012 11:07
how to import ekidata for rails

駅データ.jp から以下のようなファイルをダウンロードし、 db/seeds/ekidata とか適当な場所に置く:

  • station20121102free.csv
  • line20121030free.csv
  • company20121010.csv

マイグレーション:

# db/migrate/XXXXXXXXXXXXXX_create_ekidata_stations.rb
@frsyuki
frsyuki / status-2012-10-28.md
Created October 29, 2012 04:19
Fluentd v11 の実装状況 2
@rummelonp
rummelonp / gist:3927111
Created October 21, 2012 14:20
Twitter公式クライアントのコンシューマキー

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg

@dustalov
dustalov / invoke.py
Last active April 22, 2019 12:44
Tesuçk Invocation Script
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.
import argparse
@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)
@melborne
melborne / dsl_helper.rb
Created August 17, 2012 06:29
DSLHelper makes it easy to create DSL...
module DSLHelper
def initialize(dslfile='config', &blk)
dsl_eval(dslfile, &blk)
end
private
def dsl_eval(dslfile, &blk)
case
when blk
instance_eval &blk
#!/usr/bin/env ruby
require 'mechanize'
require 'pry'
class Agent
def initialize(login, password)
@agent = Mechanize.new
@agent.pluggable_parser['appilcation/epub+zip'] = Mechanize::Download
@login, @password = login, password
end
@kwatch
kwatch / gist:2814940
Created May 27, 2012 16:18
Rubyの特殊変数一覧
$! raise された例外オブジェクト
$" require で読み込まれたファイルの配列
$#
$$ 現在のプロセス ID
$%
$& 正規表現にマッチした箇所の文字列
$' 正規表現にマッチした箇所より後ろの文字列
$(
$)
$* Ruby スクリプトに指定された引数。ARGV と同じ
@jugyo
jugyo / gist:2699671
Created May 15, 2012 07:02
ir b with pry-remote
# Usage:
#
# ir b
#
module Kernel
alias_method :b, :binding
def ir(_binding)
Thread.start do
sleep 1
system 'osascript', '-e', 'tell application "Terminal" to do script "pry-remote"'
@nobuoka
nobuoka / twitter_list_adder.rb
Created April 22, 2012 05:59
Twitter のリストにユーザーを放り込む Ruby スクリプト
# coding: UTF-8
#==============================
# 指定した自分のリストに指定したユーザーを放り込みます.
# 多量のユーザーをリストに放り込みたいときに便利.
#==============================
# 本プログラムは OAuthSimple ライブラリを使用します.
# https://github.com/nobuoka/ruby-OAuthSimple
# で公開しているので, git clone するなりして使用してください.