View post-checkout
#! /usr/bin/env ruby
class String
# colorization
def colorize(color_code)
"\e[#{color_code}m#{self}\e[0m"
end
def red
colorize(31)
View cabal-sandbox-user-install.sh
#! /bin/sh
# Original idea came from http://maoe.hatenadiary.jp/entry/2014/12/25/064900
hash $1 2>/dev/null || {
cabal get $1
r=`ls | grep $1 | head -1`
cd $r
cabal sandbox init
cabal install -j --bindir ~/.cabal/bin --datadir ~/.cabal/share
View gist:6bff3cdd25263487c471
ubuntu@box69:~/hi$ hpc-coveralls spec --display-report -p --exclude-dir=test
{"source_files":[{"coverage":[null,null,null,null,null,null,null,null,null,null,null,null,0,null,null,null,2,null,null,0,0,0,0,0,null,null,0,0,0,0,0,null,null,0,0,0],"name":"dist/build/autogen/Paths_hi.hs","source":"module Paths_hi (\n version,\n getBinDir, getLibDir, getDataDir, getLibexecDir,\n getDataFileName, getSysconfDir\n ) where\n\nimpor
t qualified Control.Exception as Exception\nimport Data.Version (Version(..))\nimport System.Environment (getEnv)\nimport Prelude\n\ncatchIO :: IO a -> (Exception.IOException -> IO a) -> IO a\ncatchIO = Exception.catch\n\n\nversion :: Version\nversion = Version {versionBranch = [1,0,0,0], versionTags = []}\nbindir, libdir, datadir, libexecdir, sysconfdir
:: FilePath\n\nbindir = \"/home/ubuntu/hi/.cabal-sandbox/bin\"\nlibdir = \"/home/ubuntu/hi/.cabal-sandbox/lib/x86_64-lin
View guess.hs
import Control.Applicative
import Control.Exception
import System.Random
import Text.Read
main :: IO ()
main = go
go :: IO ()
go = do
View config.rb
module Api
def self.config
@@_config ||= OpenStruct.new
end
def self.configure
yield self.config
end
end
View tft2014.md

% Tools for trade 2014 % fujimura

OS and Application

  • MacBook Pro 15inch
  • Mac OS X
  • Terminal.app
  • MacVim.app
View do.hs
import System.Environment (getArgs, getProgName)
main1 :: IO ()
main1 = getArgs >>= \args ->
getProgName >>= \progn ->
print $ progn ++ " " ++ show args
main2 :: IO ()
main2 = do
args <- getArgs
View ghq_import.rb
Dir['./*']
.select {|d|File.directory? (d + "/.git") }
.map {|d| `cd #{d} ; git config remote.origin.url ; cd ../ `.chomp }
.reject {|u| u.empty? }
.each {|u| `ghq get #{u}` }
View Main.hs
{-# LANGUAGE OverloadedStrings #-}
import Network.Wai
import Network.HTTP.Types
import Network.Wai.Handler.Warp (run)
app :: Application
app _ respond = do
respond $ responseLBS
status200
[("Content-Type", "text/plain")]
View bm.rb
require 'benchmark_helper'
# Describe performance like RSpec-ish DSL
describe Api::Notifications do
before do
# Can use FactoryGirl to populate data
@me = create :user
create :post, author: @user
1000.times do