This file contains hidden or 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
// 参加セッション選択ページで実行する | |
arr = []; | |
jQuery.each($('input[name=session]:checked'), function(){ arr.push ( $(this).next().next().text() ) }); | |
arr.sort(); | |
arr.join("\n"); |
This file contains hidden or 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 'rubygems' | |
require 'rjb' | |
apache_poi_path = File.join File.dirname(__FILE__), 'poi-3.7/poi-3.7-20101029.jar' | |
apache_poi_contrib_path = File.join File.dirname(__FILE__), 'poi-3.7/poi-scratchpad-3.7-20101029.jar' | |
Rjb::load("#{apache_poi_path}:#{apache_poi_contrib_path}", ['-Xms256M', '-Xmx512M', '-Djava.awt.headless=true']) | |
slide_show = Rjb::import('org.apache.poi.hslf.usermodel.SlideShow') | |
file_os_class = Rjb::import('java.io.FileOutputStream') | |
file_class = Rjb::import('java.io.File') |
This file contains hidden or 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
UIAlertView *alert = [[UIAlertView alloc] init]; | |
alert.delegate = self; | |
alert.message = @"メッセージ"; | |
[alert addButtonWithTitle:@"OK"]; | |
[alert show]; | |
[alert release], alert = nil; |
This file contains hidden or 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
(1..100).inject(0) { |sum, i| sum + i } |
This file contains hidden or 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
javascript:(function(){ | |
var last_day = parseInt(G_lastd); | |
var str = ""; | |
for (var i=1; i<=last_day; i++) { | |
str = str + G_mm; | |
str = str + "/"; | |
str = str + document.getElementById('day' + i).innerText; | |
str = str + "("; | |
str = str + document.getElementById('week' + i).innerText; | |
str = str + ")%E3%80%80"; |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
require "mysql" | |
INSERT_COUNT = 1000000; | |
HOSTNAME = 'localhost' | |
USERNAME = 'username' | |
PASSWORD = 'password' | |
DATABASE = 'database' | |
PORT = 3306 |
This file contains hidden or 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 'openssl' | |
# 暗号化 | |
def encrypt(in_file) | |
in_filename = File::basename(in_file, '.txt') | |
out_file = open(in_filename + "_encrypted" + ".txt", "w") | |
File::open(in_file, "r") {|f| | |
f.each do |line| | |
str = line.chomp! |
This file contains hidden or 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
// google画像検索結果からオリジナル画像URLを抜いてくる | |
var dis = document.getElementsByClassName("rg_di"); | |
var img_urls = []; | |
for (var i=0; i<dis.length; i++) { | |
var href = dis[i].children[0].href; | |
var reg = /imgurl=[^&]*/; | |
var img_url_str = reg.exec(href)[0]; | |
img_urls[i] = img_url_str.replace("imgurl=", ""); | |
} |
This file contains hidden or 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
/* | |
* メルマガ、堀江貴文のブログでは言えない話よりスケジュールを抜き出し | |
* Google Calendarに登録する。 | |
*/ | |
var CALENDAR_NAME = 'ホリエモンのメディアスケジュール'; | |
var SEARCH_QUERY = '堀江貴文のブログでは言えない話 3/'; | |
var PUNCTUATION_HEADER = '■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■'; | |
var SCHEDULE_HEADER = '今週のメディアスケジュール'; | |
var PARTS_OF_SCHEDULE_HEADER = '◆◇'; | |
var PARTS_OF_SCHEDULE_FOOTER = '------------------------------'; |
This file contains hidden or 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
asin_id = "[アソシエイトID]"; | |
a = document.getElementsByTagName("a"); | |
for (var i = 0; i < a.length; i++) { | |
var url = a[i].href; | |
var res = url.indexOf("http://www.amazon.co.jp/gp/product/"); | |
if (res !== -1) { | |
var asin = url.split("/")[5] | |
a[i].href = "http://www.amazon.co.jp/o/ASIN/" + asin + "/" + asin_id; | |
} | |
} |