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
set :application, "<app_name>" | |
set :scm, :git | |
set :repository, "<repository_path>" | |
set :branch, 'master' | |
set :deploy_via, :copy | |
set :deploy_to, "<app_path>/#{application}" | |
set :use_sudo, false | |
set :rails_env, "production" | |
set :user, '<ssh_user>' |
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
// ==UserScript== | |
// @name display real image size | |
// @namespace http://www.rochefort8.com/ | |
// @include * | |
// ==/UserScript== | |
(function(){ | |
var imgs, img; | |
imgs = xpath('//img'); | |
if(!imgs.snapshotLength) return; | |
for(var i = 0; i < imgs.snapshotLength; 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
#! /usr/bin/env ruby | |
begin require 'rubygems'; rescue LoadError; end | |
$KCODE = "UTF8" | |
require 'rbosa' | |
OSA.utf8_strings = true | |
itunes = OSA.app('iTunes') | |
plist = itunes.current_playlist | |
pl_Array = plist.tracks() |
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
Option Explicit | |
Dim WShell, oExec | |
Set WShell = WScript.CreateObject("WScript.Shell") | |
Dim openPath, numArgs, argPath | |
Dim exe | |
exe = "explorer /root," | |
'exe = "C:\opt\apl\mdie0300RC6\MDIE.exe" | |
'exe = "C:\opt\apl\xf11-7\XF.exe" | |
numArgs = WScript.Arguments.Count | |
'[.][./]は引数無しと一緒(カレントパス) |
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
class Majang | |
def mati(haipai) | |
@tenpai = [] | |
mati_check(haipai.split(//).sort) | |
@tenpai.uniq! | |
@tenpai.each{|x| puts x} | |
end | |
private | |
def append_tenpai(mentu, mati) |
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 File.expand_path(File.dirname(__FILE__) + '/../majang.rb') | |
describe Majang do | |
before do | |
@m = Majang.new | |
end | |
describe "待ち無し1112224788899" do | |
before { @m.mati("1112224788899") } | |
subject { @m.tenpai} |
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
#!/usr/bin/env ruby -Ku | |
require 'rubygems' | |
require 'mechanize' | |
require 'pp' | |
URL = "http://www.dmm.com/akb48/-/akb48member/" | |
module AKB48 | |
class Scrape | |
attr_reader :team_a, :team_k, :team_b, :team_r | |
def initialize |
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
Option Explicit | |
Call Kill_Rails | |
Sub Kill_Rails | |
Dim objService, objProcesses | |
Dim proc | |
Dim query | |
query = "SELECT * FROM Win32_Process Where Name = 'ruby.exe' And CommandLine = 'ruby script\\server'" | |
Set objservice = GetObject("winmgmts:") | |
Set objProcesses = objService.ExecQuery(query) | |
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
#!/usr/bin/env ruby | |
class Tree | |
def initialize | |
@data = Array.new | |
end | |
def <<(ary) | |
@data << ary | |
end |
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 'net/http' | |
require 'json' | |
url = 'search.twitter.com' | |
path = '/search.json?q=人事異動&locale=ja&rpp=100' | |
Net::HTTP.start(url) do |http| | |
json = JSON.parse(http.get(path).body) | |
puts json['results'].map{ |r| "#{r['from_user']}: #{r['text'].gsub(/[\r|\n]/, ' ')}" } |
OlderNewer