Skip to content

Instantly share code, notes, and snippets.

@Gab-km
Gab-km / hgrc
Created September 2, 2011 08:39
hg fix "fixed message"
# hgrc
[extensions]
mq =
hgshelve = $HOME/.mercurial/extensions/hgshelve/hgshelve.py
[alias]
# fix latest commit message
fix = ! hg shelve --all -n 'tmp.hg-fix' && hg qtop > NUL & if errorlevel 1 ( hg qimport -r . && hg qrefresh -m "$1" && hg qfinish -a ) else ( hg qrefresh -m "$1" ) && hg unshelve -n 'tmp.hg-fix'
@Gab-km
Gab-km / hgrc
Created September 2, 2011 08:43
hg fix "fixed message"
# hgrc
[extensions]
mq =
hgshelve = $HOME/.mercurial/extensions/hgshelve/hgshelve.py
[alias]
# fix latest commit message
fix = ! hg shelve --all -n 'tmp.hg-fix' && hg qtop > NUL & if errorlevel 1 ( hg qimport -r . && hg qrefresh -m "$1" && hg qfinish -a ) else ( hg qrefresh -m "$1" ) && hg unshelve -n 'tmp.hg-fix'
@Gab-km
Gab-km / hgrc
Created September 4, 2011 11:17 — forked from troter/hgrc
hg fix "fixed message" # (hg 1.8.x only)
# hgrc
[extensions]
mq =
hgshelve = $HOME/.mercurial/extensions/hgshelve/hgshelve.py
[alias]
# fix latest commit message (hg 1.8.x only)
fix = ! \
$HG shelve --all -n 'tmp.hg-fix' && \
@Gab-km
Gab-km / hgrc
Created September 4, 2011 11:18 — forked from Gab-km/hgrc
hg fix ["fixed message"] (for Windows)
# hgrc
# if you use some Unix base operating systems, like Linux distributions, BSDs or Macs,
# see: https://gist.github.com/1187980
[extensions]
mq =
hgshelve = $HOME/.mercurial/extensions/hgshelve/hgshelve.py
[alias]
# fix latest commit message
@Gab-km
Gab-km / gist:1601627
Created January 12, 2012 16:56
簡易顔文字メーカー
# -*- coding: utf-8 -*-
import random
import datetime
left_brows = ['´', '`', '']
left_eyes = ['・', '^', ';', '>', '']
mouths = ['ω', '∀', 'ρ', '_', 'Д', 'д', '']
right_eyes = ['・', '^', ';', '<', '']
right_brows = ['´', '`', '']
@Gab-km
Gab-km / hgrc
Created February 19, 2012 15:10
hg now (for Windows)
# hgrc
# hg-now is the simple alias inspired by git-now.
# (http://d.hatena.ne.jp/sinsoku/20101208/1291770514)
# and it is for Windows environments.
# if you use some Unix base operating systems, like Linux distributions, BSDs or Macs,
# please hack it in your environment.
[alias]
# create a temporary commit.
now = ! hg commit -m "[from now] %date% %time%"
@Gab-km
Gab-km / myJsUnit.js
Created March 1, 2012 14:52
FizzBuzz with TDD in Javascript
function write(message) {
document.getElementById("output").innerHTML += message + "<br />";
}
function assertEquals(expected, actual) {
if (expected == actual) {
write("OK");
} else {
var text = "expected = [" + expected.toString()
+ "], but actual = [" + actual.toString() + "]."
@Gab-km
Gab-km / OptionTest.html
Created March 2, 2012 13:54
Option, which you may know as 'Maybe'.
<!DOCTYPE html>
<html>
<head>
<title>Option test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="option.js"></script>
</head>
<body>
<div id="output" />
</body>
@Gab-km
Gab-km / TupleTest.html
Created March 2, 2012 18:11
Tuples, immutable groups ... but my tuples are very poor :(
<!DOCTYPE html>
<html>
<head>
<title>Tuple test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="tuple.js"></script>
</head>
<body>
<div id="output" />
</body>
@Gab-km
Gab-km / smugnessProblem.rst
Created April 19, 2012 08:01
コードウォッチ:関数型プログラミングの自惚れ問題

コードウォッチ:関数型プログラミングの自惚れ問題

原文

http://www.sdtimes.com/link/36534

著者

Larry O'Brien

僕は関数型プログラミングが好きだ。次の10年にかけてコードの革命を起こしていくだろうと考えている:言語はより関数型の機能を採用していくだろうし、開発者はより関数型の技術を導入していくだろうし、いくつかの点では、関数型プログラミングの原則はコードを組み立てていく上で「自然で」もっとも明確なやり方だとみんな考えるようになっていくだろう。

だけど、僕はもうこのシナリオを本気にしちゃいない。関数型プログラミングは、ワクワクするものを学ぶことに興味があると言っている主流のプログラマにとって明白な、大きな問題を抱えている:関数型プログラマーは自惚れ野郎どもだってことだ。