Skip to content

Instantly share code, notes, and snippets.

Avatar

Yuki pasela

  • Japan
View GitHub Profile
@pasela
pasela / pencil256.vim
Created Mar 17, 2014
[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)
View pencil256.vim
" 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 Mar 24, 2014
[ruby] Markdown to HTML converter CLI
View md2html.rb
# encoding: utf-8
require "optparse"
require "redcarpet"
class HTMLWithSyntaxHighlighter < Redcarpet::Render::HTML
ESCAPE_HTML_TABLE = {
"'" => '&#39;',
'&' => '&amp;',
'"' => '&quot;',
View expand-tilde.go
import (
"os/user"
"strings"
)
func ExpandTilde(path string) (string, error) {
if path[0] != '~' {
return path, nil
}
@pasela
pasela / parse_bool.rb
Created Aug 21, 2015
[ruby] parse_bool.rb
View 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 Dec 17, 2011
Escape/Unescape unicode string.
View unicodeescape.vim
" 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 Oct 2, 2015
git-export - Create an unversioned copy of a tree.
View git-export
#!/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 Apr 6, 2012
PHPUnitとか使いそうなもの一式入れるコマンドの覚書
View gist:2317847
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 Apr 9, 2012
List tags with commit date.
View tagdate.sh
#!/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 Oct 5, 2015
My .Vromerc
View .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 Jun 28, 2012
nginx configuration example for Symfony2
View symfony2.conf
#
# 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;
You can’t perform that action at this time.