Skip to content

Instantly share code, notes, and snippets.

Avatar

Yuki pasela

  • Japan
View GitHub Profile
@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 / capture3_with_timeout.rb
Last active Jun 4, 2020
[ruby] capture3_with_timeout
View capture3_with_timeout.rb
# encoding: utf-8
require "timeout"
# Capture the standard output and the standard error of a command.
# Almost same as Open3.capture3 method except for timeout handling and return value.
# See Open3.capture3.
#
# result = capture3_with_timeout([env,] cmd... [, opts])
#
@pasela
pasela / README.md
Created Aug 22, 2012
mintty: A soft pastel color theme(xoria256) for mintty
View README.md

A soft pastel color theme for mintty

This is ported version of color theme xoria256.

screenshot

Settings

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

@pasela
pasela / git-su
Last active Mar 29, 2020
git-su - switches user and sshCommand in the current repository
View git-su
#!/bin/bash
#
# git-su - Git Switch User
# ========================
#
# git-su switches user and sshCommand in the current repository.
#
# USAGE
# -----
#
@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

@pasela
pasela / go-http-echo.go
Created Apr 4, 2018
Simple HTTP echo server written in Go.
View go-http-echo.go
// Simple HTTP echo server written in Go.
package main
import (
"bytes"
"context"
"flag"
"io"
"io/ioutil"
"log"
@pasela
pasela / go-http-proxy.go
Created Apr 4, 2018
Simple HTTP proxy server written in Go.
View go-http-proxy.go
// Simple HTTP proxy server written in Go.
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"net/http/httputil"
@pasela
pasela / rqrcode_ja.rb
Last active May 22, 2017
[ruby] rQRCode Japanese string
View rqrcode_ja.rb
# encoding: utf-8
require 'rqrcode'
require 'rqrcode_png'
str = '日本語てすと'
# QRコードで日本語を扱う場合はShift_JISが一般的
# 加えてライブラリの問題なのかASCII-8BITで渡さないとうまくいかない
qr_str = str.encode('CP932')
@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 / .bash_profile
Last active May 10, 2016
[shell] interactive file selection and interactive change directory
View .bash_profile
# specify your favorite filtering tool
if [[ -z "$INTERACTIVE_SELECTOR" ]]; then
if type fzy >/dev/null 2>&1; then
export INTERACTIVE_SELECTOR=fzy
elif type peco >/dev/null 2>&1; then
export INTERACTIVE_SELECTOR=peco
elif type fzf >/dev/null 2>&1; then
export INTERACTIVE_SELECTOR=fzf
fi
fi
You can’t perform that action at this time.