Skip to content

Instantly share code, notes, and snippets.

View pasela's full-sized avatar

Yuki pasela

  • Japan
View GitHub Profile
@pasela
pasela / rqrcode_ja.rb
Last active May 22, 2017 07:20
[ruby] rQRCode Japanese string
# 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 August 20, 2012 05:40
GNU screen: A patch to avoid /tmp/uscreens permission check on Cygwin
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 11:13
[shell] interactive file selection and interactive change directory
# 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
@pasela
pasela / .vimrc-dein
Created March 11, 2016 08:27
.vimrc-dein
set nocompatible
let s:dein_root = expand('~/.vim/dein')
let s:dein_path = expand(s:dein_root . '/repos/github.com/Shougo/dein.vim')
execute 'set runtimepath^=' . s:dein_path
call dein#begin(s:dein_root)
call dein#add('Shougo/dein.vim')
call dein#add('Shougo/vimproc.vim', {
\ 'build': 'make'
@pasela
pasela / download_latest_minecraft_server.sh
Created December 12, 2013 15:54
Download latest minecraft_server.jar
#!/bin/bash
DOWNLOAD_PAGE=https://minecraft.net/download
url=$(curl -Ss "$DOWNLOAD_PAGE" | grep -ohE 'http.[^"]+/minecraft_server\.[^"]+\.jar')
if [[ -n "$url" ]]; then
curl -O "$url"
fi
@pasela
pasela / pre-commit
Last active December 27, 2015 10:39
[git] Prevent commits from default user.
#!/bin/sh
git config user.name >/dev/null && git config user.email >/dev/null
if [ $? -ne 0 ]; then
cat <<EOF
Error: Attempt to commit by default user.
$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
Please set user.name and user.email using following commands.
@pasela
pasela / fizzbuzz.html
Created November 3, 2013 18:05
FizzBuzz with Twitter Bootstrap pagination.
<!DOCTYPE HTML>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>FizzBuzz</title>
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.0.4/css/bootstrap-combined.min.css" />
<style>
h1 {
@pasela
pasela / Pinky_terminal.png
Last active December 22, 2015 11:09
A Pinky color theme for iTerm2 and Terminal.app
Pinky_terminal.png
@pasela
pasela / private.xml
Created September 3, 2013 06:22
[KeyRemap4MacBook] LeaveInsMode with EISUU(vim keybind apps)
<?xml version="1.0"?>
<root>
<symbol_map type="KeyCode" name="[" value="0x1e" />
<appdef>
<appname>iTERM2</appname>
<equal>com.googlecode.iterm2</equal>
</appdef>
<list>
<item>
<name>LeaveInsMode with EISUU(vim keybind apps)</name>
@pasela
pasela / padat.vim
Last active December 21, 2015 09:19
[vim] A dark color theme for vim-airline
" vim-airline theme
"
" padat
" A dark color theme for vim-airline.
"
" Author: Yuki <paselan at Gmail.com>
" Last Change: Wed, 21 Aug 2013 09:53:56 +0900
"
" License: MIT License {{{
" Permission is hereby granted, free of charge, to any person obtaining