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
" quickrun for MRuby | |
augroup AddFileType | |
autocmd BufWinEnter,BufNewFile *.mrb set filetype=ruby.mruby | |
augroup END | |
let g:quickrun_config['mruby'] = { 'command': 'ruby.mruby' } |
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
#include <stdio.h> | |
int main(int argc, char const* argv[]) | |
{ | |
FILE *infile; | |
FILE *outfile; | |
char buf[256]; | |
int i; | |
if ((infile = fopen(argv[1], "r")) == NULL) { |
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
rails new $APP_NAME --skip-bundle -T -d postgresql | |
cd $APP_NAME | |
git init | |
# Gemfile | |
gem 'haml-rails' | |
group :development, :test do | |
gem 'thin' | |
gem 'rspec-rails' | |
end |
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 'keigo' | |
'TokyuRuby会議'.sama | |
'今日あいつが来る'.keigo | |
'あいつが今日から本を読む'.keigo |
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
$('img').draggable(); | |
$("td:contains('自己資本比率')").next().next().css("text-decoration", "underline"); |
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 'timeout' | |
require 'socket' | |
puts "Enter IP Address to Scan:" | |
ipaddress = gets | |
1.upto(1024) {|port| | |
begin | |
timeout(5) do | |
TCPSocket.open(ipaddress.chop, port) |
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
@echo off | |
rem texをpdfに変換 | |
if "%1"=="" goto USAGE | |
rem if "%1"=="" goto INPUT1 | |
goto INPUT2 | |
rem コマンドでtexファイルを指定 | |
rem :INPUT1 | |
rem set /p INP="Input tex file > " | |
rem goto CHECK |
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
remote: Failed to start new server. | |
remote: | |
remote: * * * tail of '/var/svc/log/site-node-service:default.log' * * * | |
remote: [ Mar 14 15:37:40 Stopping because all processes in service exited. ] | |
remote: [ Mar 14 15:37:40 Executing stop method (:kill). ] | |
remote: [ Mar 14 15:37:40 Executing start method ("env `cat /home/node/node-service/profile` /home/node/.nvm/v0.4.12/bin/node /home/node/node-service/releases/20120314153548/server.js &"). ] | |
remote: [ Mar 14 15:37:40 Method "start" exited with status 0. ] | |
remote: env: /home/node/.nvm/v0.4.12/bin/node: No such file or directory | |
remote: [ Mar 14 15:37:40 Stopping because all processes in service exited. ] | |
remote: [ Mar 14 15:37:40 Executing stop method (:kill). ] |
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
現在rubyからfirefoxなどを実行する方法を調査中。 | |
クライアント | |
#!/bin/ruby | |
require 'yaml' | |
require 'rubygems' | |
require 'stomp' | |
conn = Stomp::Client.new("test", "", "localhost", 61613) | |
dest = "/queue/stomp_sample" |
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
# Mechanize http://d.hatena.ne.jp/takuya_1st/20120301/1330605502 | |
mech = Mechanize.new | |
mech.user_agent_alias = 'Windows IE 7’ #キーを指定。 | |
AGENT_ALIASES = { | |
'Windows IE 6' => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)', | |
'Windows IE 7' => 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)', | |
'Windows Mozilla' => 'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4b) Gecko/20030516 Mozilla Firebird/0.6', | |
'Mac Safari' => 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; de-at) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10', | |
'Mac FireFox' => 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6', |
NewerOlder