Skip to content

Instantly share code, notes, and snippets.

Avatar

Yuki pasela

  • Japan
View GitHub Profile
@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;
@pasela
pasela / cakephp2.conf
Created Jul 5, 2012
nginx configuration example for CakePHP 2.x
View cakephp2.conf
#
# nginx configuration example for CakePHP 2.x
#
server {
listen 80;
server_name cakephp2.example;
root /var/www/cakephp2/app/webroot;
access_log /var/log/nginx/cakephp2.access.log;
error_log /var/log/nginx/cakephp2.error.log;
@pasela
pasela / screen-4.1.0-cygwin-sock-permission.patch
Created Aug 20, 2012
GNU screen: A patch to avoid /tmp/uscreens permission check on Cygwin
View screen-4.1.0-cygwin-sock-permission.patch
diff --git a/src/screen.c b/src/screen.c
index 6e19732..3a8ca3e 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -1102,8 +1102,10 @@ char **av;
n = (eff_uid == 0 && (real_uid || (st.st_mode & 0775) != 0775)) ? 0755 :
(eff_gid == (int)st.st_gid && eff_gid != real_gid) ? 0775 :
0777;
+#if !defined(__CYGWIN__)
if (((int)st.st_mode & 0777) != n)
@pasela
pasela / export-mintty-color.rb
Created Aug 21, 2012
Convert .minttyrc color settings to escape sequences.
View export-mintty-color.rb
# encoding: utf-8
# Convert .minttyrc color settings to escape sequences.
#
# USAGE:
# ruby export-mintty-color.rb [minttyrc_file]
#
# minttyrc_file target rc file(default is ~/.minttyrc)
COLOR_SETTINGS = {
@pasela
pasela / README.md
Created Aug 21, 2012
mintty: A pastel color theme for mintty
View README.md

A pastel color theme for mintty

screenshot

Settings

Merge mintty-color-pastel-rc into your .minttyrc

or

You can’t perform that action at this time.