Skip to content

Instantly share code, notes, and snippets.

removeNonUppercase :: [Char] -> [Char]
removeNonUppercase st = [ c | c <- st, c `elem` ['A'..'Z']]
@igaiga
igaiga / alfread_item2.as
Last active February 7, 2016 02:34
alfread item2 custom terminal setting
on alfred_script(q)
if application "iTerm" is running then
run script "
on run {q}
tell application \":Applications:iTerm.app\"
activate
tell the first terminal
tell current session to write text q
end tell
end tell
rightTriangles =[(a,b,c)|c<-[1..10],a<-[1..c],b<-[1..a]
, a^2+b^2==c^2, a+b+c==24]
--- Prelude> rightTriangles #=> [(8,6,10)]
@igaiga
igaiga / fonts.rb
Last active August 29, 2015 14:28
fonts = [1,2,3]
fonts.each do |font_id|
filename = "font_ss_#{font_id}.jpg"
system "curl [URL] -o #{filename}"
end
class Fibo
def calc(n)
a = 0
b = 1
return [1] if n == 1
result = [1]
while a + b <= n
result << a + b
a = result[-2]
株式会社 spice life
[株式会社 spice life](http://spicelife.jp/)がつくるのはECの分野、ちょっと変わった、ちょっと新しい、ちょっと世の中を良くするサービスです。[オリジナルTシャツ作成サービスtmix](http://tmix.jp/)はスタッフTシャツづくりを通じて各地のRubyKaigiを応援しています。
# [ ]( ) をリンクに置き換えてください
str = "a\nb\nc"
File.open("dumped.txt","w") do |f|
f.puts Marshal.dump(str)
end
str_reloaded = File.open("dumped.txt", "r") do |f|
Marshal.load(f.read)
end
p str_reloaded #=> "a\nb\nc"
;; C-o の改行した先をインデントする版
(provide 'insert-new-line)
(defun insert-new-line()
(interactive)
(save-excursion ;ポインタ位置を記憶して終了したら元に戻す
(open-line 1)
(forward-line)
(indent-for-tab-command)
)
)
@igaiga
igaiga / race.md
Last active August 29, 2015 14:16
レース得点ルール

競技について

競技時間

7分

競技回数

  • 競技は各チーム2回実施する
  • 2回のうち、良い方の点数がそのチームの点数となる

競技中の注意

  • 場外に出て10秒経ったら失格