This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
#= dump database to yaml for fixtures | |
# | |
# originated by elm200 <http://d.hatena.ne.jp/elm200/20070928/1190947947> | |
# | |
#== install | |
# | |
# move this file to RAILS_ROOT/lib/tasks/extract_fixtures.rake | |
# | |
namespace :db do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ja: | |
# extract from activesupport | |
date: | |
formats: | |
default: "%Y/%m/%d" | |
short: "%m/%d" | |
long: "%Y年%m月%d日(%a)" | |
day_names: [日曜日, 月曜日, 火曜日, 水曜日, 木曜日, 金曜日, 土曜日] | |
abbr_day_names: [日, 月, 火, 水, 木, 金, 土] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for background, see http://m.onkey.org/use-index-with-active-record-finders | |
# and http://twitter.com/#!/dougalcorn/status/4963159878139904 | |
from = "#{quoted_table_name} USE INDEX(index_activities_on_created_at_and_country_id)" | |
Activity.from(from).where('created_at >= ? AND country_id = ?', 10.days.ago, 79).all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
obj-m += tcp_svr_sample.o | |
all: | |
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules | |
clean: | |
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "csv" | |
MAX = 50 | |
EXISTING = 18 | |
EMAILCOLNUM = 5 | |
DUPLICATE = 1 | |
def create_data | |
result = [] | |
#csv取得 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define :generate_ssh_keys, :user_account => nil do | |
username = params[:user_account] | |
raise ":user_account should be provided." if username.nil? | |
Chef::Log.debug("generate ssh skys for #{username}.") | |
execute "generate ssh skys for #{username}." do | |
user username | |
creates "/home/#{username}/.ssh/id_rsa.pub" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Fabricate | |
class << self | |
def unique(name, overrides={}, &block) | |
schematic = Fabrication::Fabricator.schematics[name] | |
raise Fabrication::UnfabricatableError, "No fabricator found for '#{name}'" unless schematic | |
# pull out the fabricator_id | |
fabricator_id = overrides[:fabricator_id] || schematic.attribute(:fabricator_id) || name | |
# set the overriden fabricator_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def small_tag_start | |
return '' unless request.mobile? | |
case request.mobile | |
when Jpmobile::Mobile::Docomo | |
'<span style="font-size:smaller">' | |
when Jpmobile::Mobile::Au | |
if ['CA31','CA32','CA33','HI33','HI34','HI35','HI36','SA31','TS31','SH3D'].member?(request.mobile.device_id) | |
'<font style="font-size:12px">' | |
elsif ['CA3E','KC35','KC36','KC37','KC38','KC3O','KC3H','KC3K','SH3B','TS3O','TS3H','SN3I','HI3G','KC3R'].member?(request.mobile.device_id) | |
'<font style="font-size:15px">' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io" | |
"log" | |
"net/http" | |
"os" | |
) |
OlderNewer