Skip to content

Instantly share code, notes, and snippets.

@yewton
yewton / find_and_sort_by_mtime.sh
Last active December 11, 2015 17:28
find した結果を mtime 順にソートする
find -type f | xargs ls -l --time-style long-iso | sort -k6d -k7d

Haskell チートシート

インストール

$ brew install ghc
$ brew install --env=std haskell-platform

REPL起動

@yewton
yewton / git-svn-externals.rb
Created November 14, 2012 03:45 — forked from koshigoe/git-svn-externals.rb
clone svn:externals
#!/usr/bin/env ruby
#
# Inspired by https://github.com/andrep/git-svn-clone-externals
#
# MIT License http://koshigoe.mit-license.org
#
require 'fileutils'
module Git
@yewton
yewton / emacs.idekeybindings
Created August 22, 2012 16:09 — forked from taksatou/emacs.idekeybindings
more emacs like keybindings for xcode 4.3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Menu Key Bindings</key>
<dict>
<key>Key Bindings</key>
<array>
<dict>
<key>Action</key>
@yewton
yewton / znc-0.206.20120807.diff
Created August 7, 2012 06:21
ZNCのPlaybackをNoticeにする
diff -Naru znc-0.206.orig/Chan.cpp znc-0.206/Chan.cpp
--- znc-0.206.orig/Chan.cpp 2012-04-06 04:25:50.000000000 +0900
+++ znc-0.206/Chan.cpp 2012-08-07 16:31:17.000000000 +0900
@@ -570,7 +570,7 @@
MODULECALL(OnChanBufferStarting(*this, *pUseClient), m_pUser, NULL, bSkipStatusMsg = true);
if (!bSkipStatusMsg) {
- m_pUser->PutUser(":***!znc@znc.in PRIVMSG " + GetName() + " :Buffer Playback...", pUseClient);
+ m_pUser->PutUser(":***!znc@znc.in NOTICE " + GetName() + " :Buffer Playback...", pUseClient);
}
@yewton
yewton / znc-0.206.20120727.diff
Created July 27, 2012 06:14
ZNC の playback を Notice に
diff -Naru znc-0.206.orig/Client.cpp znc-0.206/Client.cpp
--- znc-0.206.orig/Client.cpp 2012-07-27 14:52:48.000000000 +0900
+++ znc-0.206/Client.cpp 2012-07-27 14:56:31.000000000 +0900
@@ -430,7 +430,7 @@
CChan* pChan = m_pUser->FindChan(sTarget);
if ((pChan) && (pChan->KeepBuffer())) {
- pChan->AddBuffer(":" + GetNickMask() + " PRIVMSG " + sTarget + " :" + m_pUser->AddTimestamp(sMsg));
+ pChan->AddBuffer(":" + GetNickMask() + " NOTICE " + sTarget + " :" + m_pUser->AddTimestamp(sMsg));
}
@yewton
yewton / gist:3130598
Created July 17, 2012 16:59
key-chord setting
;; key-chord
(require 'key-chord)
(key-chord-mode 1)
(devar key-chord-bindings
'(("hf" . describe-function)
("hb" . describe-bindings)
("hv" . describe-variable)
("rs" . replace-string)
("rp" . replace-regexp)
("a;" . goto-line)
@yewton
yewton / cmigemo.rb
Created July 14, 2012 19:52
Formula for cmigemo
# -*- coding: utf-8 -*-
require 'formula'
class Cmigemo < Formula
url 'http://cmigemo.googlecode.com/files/cmigemo-default-src-20110227.zip'
homepage 'http://www.kaoriya.net/software/cmigemo'
sha1 '25e279c56d3a8f1e82cbfb3526d1b38742d1d66c'
depends_on 'nkf'
@yewton
yewton / generate_ricty.sh
Created July 14, 2012 08:56
Generate Ricty on Mac OS X Lion
#!/bin/sh
brew install fontforge
brew install wget
git clone https://github.com/yascentur/Ricty.git Ricty
cd Ricty && \
wget http://levien.com/type/myfonts/Inconsolata.otf && \
wget http://iij.dl.sourceforge.jp/mix-mplus-ipa/56156/migu-1m-20120411-2.zip && \
unzip migu-1m-20120411-2.zip && \
cd migu-1m-20120411-2 && \
cp migu-1m-*.ttf ../ && \
@yewton
yewton / myphpmd.pl
Created June 11, 2012 04:10
myphpmd
#!/usr/bin/perl
use strict;
my $source = $ARGV[0];
my $type = $ARGV[1];
my $rules = $ARGV[2];
my $result = `phpmd ${source} ${type} ${rules}`;
$result =~ s/^\s+//g;
$result =~ s/(:[0-9]+)/$1:/g;