Skip to content

Instantly share code, notes, and snippets.

View pasela's full-sized avatar

Yuki pasela

  • Japan
View GitHub Profile
@pasela
pasela / pencil256.vim
Created March 17, 2014 08:55
[vim] Vim Color Scheme: pencil256.vim is a derived version of pencil.vim. pencil256 supports terminal-based Vim without pencil color scheme for the terminal. (Original pencil.vim requires it such as iterm-colors-pencil)
" Vim Color File
"
" pencil256.vim is a derived version of pencil.vim. pencil256 supports
" terminal-based Vim without pencil color scheme for the terminal.
" (Original pencil.vim requires it such as iterm-colors-pencil)
"
" In terminal-based Vim, pencil256 has a little difference of colors, because
" pencil256 uses the default palette of the terminal (such as xterm 256 color).
"
" Name: pencil256.vim
@pasela
pasela / md2html.rb
Created March 24, 2014 08:07
[ruby] Markdown to HTML converter CLI
# encoding: utf-8
require "optparse"
require "redcarpet"
class HTMLWithSyntaxHighlighter < Redcarpet::Render::HTML
ESCAPE_HTML_TABLE = {
"'" => '&#39;',
'&' => '&amp;',
'"' => '&quot;',
@pasela
pasela / expand-tilde.go
Created October 28, 2014 17:04
[go] ExpandTilde
import (
"os/user"
"strings"
)
func ExpandTilde(path string) (string, error) {
if path[0] != '~' {
return path, nil
}
@pasela
pasela / parse_bool.rb
Created August 21, 2015 08:48
[ruby] parse_bool.rb
# encoding: utf-8
# 論理値に変換する
#
# falseとなる値
# nil, false, 0
# falseとなる文字列(大文字小文字区別なし)
# 0, 0.0, f, false, n, no, off, 空文字, 空白文字のみ
# trueとなるもの
# 上記以外
@pasela
pasela / unicodeescape.vim
Created December 17, 2011 19:30
Escape/Unescape unicode string.
" unicodeescape.vim - Escape/Unescape unicode string.
function! UnicodeEscapeString(str)
let oldenc = &encoding
set encoding=utf-8
let escaped = substitute(a:str, '[^[:alnum:][:blank:][:cntrl:][:graph:]]', '\=printf("\\u%04x", char2nr(submatch(0)))', 'g')
let &encoding = oldenc
return escaped
endfunction
@pasela
pasela / git-export
Last active October 2, 2015 17:58
git-export - Create an unversioned copy of a tree.
#!/bin/sh
#
# git-export - Create an unversioned copy of a tree.
#
# USAGE
# git export [<tree-ish>] <path>
#
# Author: Yuki <paselan@gmail.com>
# License: MIT License
#
@pasela
pasela / gist:2317847
Created April 6, 2012 07:07
PHPUnitとか使いそうなもの一式入れるコマンドの覚書
wget http://pear.php.net/go-pear.phar
php go-pear.phar
pear update-channels
pear clear-cache
pear upgrade
pear config-set auto_discover 1
pear install pear.pdepend.org/PHP_Depend
pear install pear.phpmd.org/PHP_PMD
pear install pear.phpunit.de/PHPUnit
pear install pear.phpunit.de/phpcpd
@pasela
pasela / tagdate.sh
Created April 9, 2012 03:22
List tags with commit date.
#!/bin/bash
#
# List tags with commit date.
#
for tag in $(git tag)
do
ldate=$(git log -1 --pretty=format:%cd --date=local $tag)
date=$(date +"%F %T" -d "$ldate")
echo -e "$tag\t$date"
@pasela
pasela / .Vromerc
Last active October 5, 2015 00:38
My .Vromerc
set disablesites=mail.google.com,reader.livedoor.com,github.com,bitbucket.org,trello.com,www.blogger.com/blogger.g,stackedit.io
set enable_vrome_key=<C-z>
" set autocomplete_prev=<C-n>
" set autocomplete_next=<C-p>
set hintkeys=jlkhfsdagwerui
set useletters=1
unmap <M-d>
unmap <M-f>
unmap do
@pasela
pasela / symfony2.conf
Created June 28, 2012 03:25
nginx configuration example for Symfony2
#
# nginx configuration example for Symfony2
#
server {
listen 80;
server_name symfony2-example;
root /var/www/sf2/web;
access_log /var/log/nginx/sf2.access.log;
error_log /var/log/nginx/sf2.error.log;