Skip to content

Instantly share code, notes, and snippets.

@monmon
monmon / q4.21.js
Created March 17, 2014 11:24
sicpの問題4.21が一瞬読めなかったのでJavaScriptで書く
(function (n) {
return (function (fact) {
return fact(fact, n);
})(function (ft, k) {
return (k === 1) ? 1
: k * (ft(ft, (k - 1)));
});
})(10)
@monmon
monmon / gist:d5c7a1f784818225abe6
Created May 22, 2014 01:40
git rm でファイルを削除した時、そのファイルがあったディレクトリが空になるならば、そのディレクトリごと削除される
[10:37] ~/tmp/2014-05-22/test
% git --version
git version 1.9.0
[10:37] ~/tmp/2014-05-22/test
% git init
Initialized empty Git repository in /Users/no-kumagai/tmp/2014-05-22/test/.git/
[10:37] ~/tmp/2014-05-22/test
(git)-[master]-% ll
@monmon
monmon / substr_bug.pl
Last active August 29, 2015 14:04
Perl v5.8.5で内部文字列をsubstrするとbugる
#!perl
use strict;
use warnings;
use utf8;
use Devel::Peek;
my $str = '{"a":"b","c":"あ"}';
Dump $str;
print <<EOS;
// ==UserScript==
// @name LDR_hide_mark_read
// @namespace http://github.com/monmon
// @description hide mark read.
// @include http://reader.livedoor.com/reader/
// ==/UserScript==
(function () {
var count = 0;
// ==UserScript==
// @name hatena_bookmark_cmptag
// @namespace http://github.com/monmon
// @description 「おすすめタグ」と「キーワード」に自分のタグがあれば目立たせる
// @include http://b.hatena.ne.jp/add*
// @include http://b.hatena.ne.jp/*/edit*
// ==/UserScript==
(function(){
// ==UserScript==
// @name nifty_cilp_rss_search
// @namespace http://github.com/monmon
// @description googleの検索結果に自分のクリップを入れる
// @include http://www.google.co.jp/*
// ==/UserScript==
(function(){
var user = 'monmon'; // 自分のユーザ名
// ==UserScript==
// @name showYouTubeInGoogleSearch
// @namespace http://github.com/monmon
// @description Show YouTube Flash in Google search result
// @include http://www.google.co.jp/search*
// ==/UserScript==
(function() {
var length = 0;
#!/usr/bin/env perl
use strict;
use warnings;
use LWP::UserAgent;
use Socket;
use Data::Dumper;
BEGIN {
*inet_aton = \&Socket::inet_aton;
@monmon
monmon / gist:3141604
Created July 19, 2012 08:35
Sparrowで使われているoverlayのmenuサンプルであるMHTabBarController