This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Usage | |
# % ./ambiwidth.rb | |
# % sudo cp UTF-8-CJK.gz /usr/share/i18n/charmaps/ | |
# % sudo vim /etc/locale.gen # Add "ja_JP.UTF-8 UTF-8-CJK" | |
# % sudo locale-gen | |
require 'open-uri' | |
require 'zlib' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# coding: utf-8 | |
require 'open3' | |
require 'tempfile' | |
class Avconv | |
def initialize(path, bin = 'avconv') | |
@path = path | |
@bin = bin | |
@tempfile = Tempfile.new ['sd-hd', '.ts'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nnoremap <C-g> :<C-u>call <SID>ruby_gf()<CR> | |
function! s:ruby_gf() | |
let l:saved_isfname = &l:isfname | |
setlocal isfname+=: | |
let l:cfile = expand('<cfile>') | |
let &l:isfname = l:saved_isfname | |
let l:match = matchlist(l:cfile, '\(\f\+\):\(\d\+\)') | |
normal! gf | |
if !empty(l:match) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'nokogiri' | |
module FromXml | |
class MappingError < StandardError | |
attr_reader :node | |
def initialize(node, msg = nil) | |
super msg | |
@node = node | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
int f(int E, int R, const vector<int>& v, const vector<int>& x, int idx) | |
{ | |
const int N = v.size(); | |
int e1 = E; | |
for (int i = 0; i < idx; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compdef cabal-dev | |
_cabal-dev() { | |
local curcontext="$curcontext" state | |
_arguments -C \ | |
{-h,-?,--help}'[Show help text]' \ | |
{-s,--sandbox}'[The location of the development cabal sandbox (default: ./cabal-dev)]:directory:_directories' \ | |
{-c,--config}'[The location of the cabal-install config file (default: use included)]:file:_files' \ | |
{-v,--verbose}'[Verbosity level]:verbosity:_cabal-dev_verbosity' \ | |
--version'[Show the version of this program]' \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE TemplateHaskell #-} | |
module Bar (bar) where | |
import Foo (foo) | |
bar = $foo ++ "bar" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/autoload/necoghc.vim b/autoload/necoghc.vim | |
index 9b43ec8..d1d35e6 100644 | |
--- a/autoload/necoghc.vim | |
+++ b/autoload/necoghc.vim | |
@@ -202,9 +202,17 @@ function! s:get_modules() "{{{ | |
endfunction "}}} | |
function! s:ghc_mod(cmd) "{{{ | |
+ let l:cmd = 'ghc-mod -g -package -g ghc ' . a:cmd | |
lcd `=expand('%:p:h')` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ur xmonad-contrib-0.11.orig/XMonad/Hooks/DebugEvents.hs xmonad-contrib-0.11/XMonad/Hooks/DebugEvents.hs | |
--- xmonad-contrib-0.11.orig/XMonad/Hooks/DebugEvents.hs 2013-02-27 00:30:37.840686030 +0900 | |
+++ xmonad-contrib-0.11/XMonad/Hooks/DebugEvents.hs 2013-02-27 00:48:45.208871862 +0900 | |
@@ -42,13 +42,15 @@ | |
import Data.Maybe (fromMaybe) | |
import Data.Monoid | |
import Foreign | |
-import Foreign.C.String | |
import Foreign.C.Types | |
import Numeric (showHex) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# USAGE: | |
# % ifuse ~/mnt | |
# % ./purchased.rb ~/mnt | |
require 'pathname' | |
require 'sqlite3' | |
iphone = Pathname.new ARGV[0] |