git cat-file commit master | awk '/^parent.*/{print $0}; //{print $0}' | git hash-object --stdin -w -t commit | xargs git checkout -B master
Here it is:
$> git show --stat
commit 52eb56f6d5816f9e43015878e60a41cbbfb3e702
// es = map exists tasks | |
List<Boolean> es = Lists.transform(tasks, new Function<File, Boolean>() { | |
@Override | |
public Boolean apply(File file) { | |
return file.exists(); | |
} | |
}); | |
def get_hostid_by_itemid(itemid) | |
message = { | |
'method' => 'host.get', | |
'params' => { | |
'itemids' => [itemid.to_s] | |
} | |
} | |
return send_request(message).first["hostid"] | |
end |
#!/usr/bin/env ruby | |
require 'gnuplot' | |
require 'ostruct' | |
def read file | |
times = [] | |
File.open(file).each do |line| | |
_,a,_ = line.split(' ') | |
times << Float(a)/1000000 |
#!/bin/bash | |
set -e | |
########################## | |
# INSTALL GHC | |
########################## | |
GHC="ghc.tar.bz2" | |
# install depends | |
sudo apt-get install --assume-yes libgmp3c2 |
exception NoAnswer | |
val only_capitals = List.filter (fn s => Char.isUpper (String.sub (s,0))) | |
val longest_string1 = foldl (fn (s,m) => if String.size s > String.size m then s else m) "" | |
val longest_string2 = foldl (fn (s,m) => if String.size s >= String.size m then s else m) "" | |
fun longest_string_helper p = foldl (fn (s,m) => if (p (String.size s) (String.size m)) then s else m) "" |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'git' | |
require 'fileutils' | |
# Directory that suppose to be in $PATH | |
bin_dir = File.join(Dir.home, 'bin') | |
smackage_dir = File.join(Dir.home, 'projects/smackage') |
(* routines *) | |
fun map f (x::xs) = f x :: map f xs | |
| map _ [] = [] | |
fun concat (x::xs) = x @ concat xs | |
| concat [] = [] | |
fun mapPartial _ [] = [] | |
| mapPartial f (x::xs) = case f x | |
of SOME v => v :: (mapPartial f xs) |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE UnicodeSyntax #-} | |
import Control.Applicative (many, (<$>), (<*)) | |
import Control.Lens | |
import Data.Attoparsec.Text.Lazy | |
import qualified Data.HashMap.Strict as M | |
import Data.List (nub, sort) | |
import Data.Text.Lazy.IO as T | |
import qualified Algo.BellmanFord as BF |
# Deploying haddocks | |
# | |
# cap deploy:haddocks | |
load 'deploy' | |
ssh_options[:forward_agent] = true | |
after "deploy:create_symlink", "deploy:cleanup" |