転職に伴い石川県から東京都に引っ越した
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
# -*- coding: utf-8 -*- | |
require "tempfile" | |
desc "scaffoldで生成されたコントローラーからrespond_toブロックを消す" | |
namespace :my do | |
task :rm_respond_to do | |
Dir::glob("app/controllers/*_*.rb") do |ctrl| | |
if !(File::basename(ctrl) =~ /application/) | |
temp = Tempfile::new("tmp",Dir::pwd) | |
open(ctrl) do |f| | |
text = f.read |
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 'oauth' | |
require 'json' | |
require 'cgi' | |
class Tumblr4r | |
def initialize(access_token) | |
@access_token = access_token | |
end | |
def api_key |
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
# -*- coding: utf-8 -*- | |
# CSA形式の棋譜を表すクラス | |
class CsaRecord | |
Sente = true | |
Gote = false | |
attr_accessor :file | |
def initialize( *args ) | |
option = args.pop | |
case option |
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
Man-bookmark-jump | |
abbrev-edit-save-buffer | |
abbrev-edit-save-to-file | |
abbrev-table-empty-p | |
allout-auto-activation-helper | |
allout-setup | |
allout-widgets-mode | |
allout-widgets-setup | |
balance-windows-1 | |
balance-windows-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
$ -> | |
game = new Main() | |
game.start() | |
#共通ライブラリ | |
#行列演算のための関数 | |
##行列の和 | |
addArray = (array1, array2) -> | |
array = [] | |
len = array1.length |
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
#!/usr/bin/env sh | |
UUID=$(defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID) | |
echo Xcode DVTPlugInCompatibilityUUID is $UUID | |
for MyPlugin in ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/* | |
do | |
UUIDs=$(defaults read "$MyPlugin"/Contents/Info DVTPlugInCompatibilityUUIDs) | |
echo $MyPlugin | |
if echo "${UUIDs[@]}" | grep -w "$UUID" &>/dev/null; then | |
echo "The plug-in's UUIDs has contained the Xcode's UUID." | |
else |
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 Module | |
def wrap_package_private name | |
wraped_method = instance_method(name) | |
define_method(name) do |*args| | |
# check | |
puts "checking package_private: #{name}" | |
if true | |
e = NoMethodError.new("package private method is called from outside of the package") | |
e.set_backtrace caller |
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
[1m Build[0m ./build/iPhoneSimulator-6.1-Development | |
[1m Compile[0m /var/folders/nl/vdz7nrv12zj44kcjg_vmpr1r0000gn/T/motion_env20130830-12748-1c625u6.rb | |
2013-08-30 16:21:51.931 ruby[12824:f0f] No such file or directory -- /var/folders/nl/vdz7nrv12zj44kcjg_vmpr1r0000gn/T/motion_env20130830-12748-1c625u6.rb (LoadError) | |
2013-08-30 16:21:51.932 ruby[12824:f0f] *** Terminating app due to uncaught exception 'LoadError', reason: 'No such file or directory -- /var/folders/nl/vdz7nrv12zj44kcjg_vmpr1r0000gn/T/motion_env20130830-12748-1c625u6.rb (LoadError) | |
' | |
*** Call stack at first throw: | |
( | |
0 CoreFoundation 0x93cdbe8b __raiseError + 219 | |
1 libobjc.A.dylib 0x9716852e objc_exception_throw + 230 | |
2 ruby 0x0013a419 rb_rescue2 + 793 |
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
;;;###autoload | |
(defun japanese-hankaku-region-only-katakana (from to &optional ascii-only) | |
(interactive "r\nP") | |
(save-restriction | |
(narrow-to-region from to) | |
(save-excursion | |
(goto-char (point-min)) | |
(while (re-search-forward "\\cK" nil t) | |
(let* ((zenkaku (preceding-char)) | |
(zenkaku-str (char-to-string zenkaku)) |
OlderNewer