Skip to content

Instantly share code, notes, and snippets.

@doloopwhile
doloopwhile / gist:5544ca551547a5526071
Created June 5, 2014 05:39
ltsv with method chaining
package main
type Pair struct {
Key string
Value string
}
type LTSV struct {
values []Pair
}
@doloopwhile
doloopwhile / gist:d14dca96a3b5bcf3c5eb
Last active August 29, 2015 14:02
My vim build script for Xubuntu 14.04
hg checkout v7-3-367
sudo apt-get install -y \
mercurial \
gettext \
libncurses5-dev \
libgtk2-dev \
libxt-dev
@doloopwhile
doloopwhile / git-rebase-i-peco
Last active August 29, 2015 14:03
git-rebase-i-peco: select rebase -i target
#!/bin/bash
set -o pipefail
set -e
HASH=$(git log --oneline | peco | cut -d " " -f 1)
if [ "$?" -ne 0 -o -z "$HASH" ]; then
exit 1
fi
git rebase -i "$HASH" $@
# install:
@doloopwhile
doloopwhile / align.go
Created July 29, 2014 01:49
Align table
package main
func main() {
}
@doloopwhile
doloopwhile / open-gvim.sh
Created September 4, 2014 02:51
A script to open file in gvim (suport "/path/to/file:42" format)
#!/bin/bash
#
# open-gvim.sh
#
# - Open a file with gvim
# - If there is running gvim open file in there.
# - Open "path with line number" (like "/path/to/file:42" printed in grep and etc.)
if [ "$#" -eq 0 ]; then
if vim --serverlist | grep -q GVIM; then
import Text
main : Element
main = collage 500 500 [scale 0.5 (form (500, 500))]
form (w, h) =
toForm
(layers
[ fittedImage w h "/shells.jpg"
, container w h bottomLeft (centered (Text.color white (toText "She sells sea shells.")))
#!/usr/bin/env ruby
require 'yaml'
require 'pp'
ARGV.each do |a|
y = open(a) do |f|
YAML.load(f)
end
sort = lambda do |x|
import String
import Graphics.Input (Input, input)
import Graphics.Input.Field as Field
lhd : Input Field.Content
lhd = input Field.noContent
rhd : Input Field.Content
rhd = input Field.noContent
@doloopwhile
doloopwhile / fractal.png
Last active August 29, 2015 14:10
Sierpinski gasket with Elm
fractal.png
@doloopwhile
doloopwhile / gist:690b3142bffca2f03fe8
Created February 22, 2015 10:00
パンは危険な食べ物
ある食べ物が身体にいいという話はよく聞きますが、アメリカの調査結果によれば、パンは危険な食べ物だということがわかりました。パン食が増えている日本も他人事ではありません!
その驚愕の事実をご紹介します。
・犯罪者の98%はパンを食べている
・パンを日常的に食べて育った子供の約半数は、テストが平均点以下である
・暴力的犯罪の90%は、パンを食べてから24時間以内に起きている
・パンは中毒症状を引き起こす。被験者に最初はパンと水を与え、後に水だけを与える実験をすると、2日もしないうちにパンを異常にほしがる
・新生児にパンを与えると、のどをつまらせて苦しがる
・18世紀、どの家も各自でパンを焼いていた頃、平均寿命は50歳だった