Skip to content

Instantly share code, notes, and snippets.

" こういうHTMLがあったときに
" <div id="hoge" class="fuga">
" ...
" </div>
"
" 実行するとこうなる
" <div id="hoge" class="fuga">
" ...
" <!-- /div#hoge.fuga --></div>
@masuidrive
masuidrive / Rakefile
Created June 26, 2010 22:54
build Rakefile for Titanium mobile on OSX
#
# Titanium mobile Rakefile for iPhone build
#
DEV_PROVISIONING_UUID = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
DEV_SIGN = "Developer name"
DEV_APP_NAME = "DevApp"
DEV_APP_ID = 'com.example.dev'
TITANIUM_SDK_VERSION = '1.3.2'
@radamant
radamant / haml_converter.rb
Created July 19, 2010 14:16
Simple haml-sass conversion for jekyll
module Jekyll
require 'haml'
class HamlConverter < Converter
safe true
priority :low
def matches(ext)
ext =~ /haml/i
end
@ongaeshi
ongaeshi / file_test_utils.rb
Created February 21, 2011 10:52
rubyのファイルテスト用ユーティリティ
# -*- coding: utf-8 -*-
#
# @file
# @brief ファイルテスト用ユーティリティ
# @author ongaeshi
# @date 2011/02/21
#
#
# 以下のことを自動でやってくれます
#
describe "GET current" do
before do
@request.cookies['hidden_notices'] = "1,#{notices(:permanent).id}"
get :current, :format => 'js'
end
it { should respond_with(:success) }
it { should set_cookie(:hidden_notices).to("#{notices(:permanent).id}") }
it { should render_template('notices/current') }
end
@juno
juno / gemref
Created April 9, 2011 17:23
display runtime gem information in ./Gemfile
#!/usr/bin/env ruby
require 'ansi/code'
require 'bundler'
require 'json'
require 'open-uri'
class Integer
def to_currency
self.to_s.reverse.gsub(/(\d{3})(?=\d)/, '\1,').reverse
end
@jpr5
jpr5 / bot.rb
Created April 26, 2011 07:13
XMPP/Ruby Bot for HipChat
#!/usr/bin/env ruby
#
# Script: HipChat bot in Ruby
# Author: Jordan Ritter <jpr5@darkridge.com>
#
unless `rvm-prompt i g`.chomp == "ree@xmpp"
exec("rvm ree@xmpp ruby #{$0}")
end
@joakimk
joakimk / bot.rb
Created April 29, 2011 06:05 — forked from jpr5/bot.rb
XMPP/Ruby Bot for HipChat with support for multiple rooms
#!/usr/bin/env ruby
require 'rubygems'
require 'xmpp4r'
require 'xmpp4r/muc/helper/simplemucclient'
# Most of this is borrowed from https://gist.github.com/941931
# Added support for multiple rooms and external handling of messages.
# We want the MUC functionality to just handle shit for us. Unfortunately we
# have to override/repeat the join method in order to add the directive that
@kennyj
kennyj / rails_3_1_RC4_changes.md
Created May 6, 2011 17:34 — forked from ryanb/rails_3_1_rc4_changes.md
Rails 3.1 RC4の変更点(和訳)

Railties 3.1 RC4

  • 新しいrakeタスク assets:clean はプリコンパイルされたアセットを削除する。

  • --skip-gemfile--skip-bundleなしでの、アプリケーションとプラグインのソース生成は、bundle installを走らせる

  • jdbc*アダプターにとってのデータベースタスクを修正した

  • jdbcpostgresqlにとってのテンプレート生成

@udzura
udzura / README.rdoc
Created May 15, 2011 05:38
rack-rewrite README in japanese