Skip to content

Instantly share code, notes, and snippets.

View high5's full-sized avatar
🎯
Focusing

Hiroki K high5

🎯
Focusing
View GitHub Profile
@high5
high5 / gist:8935456
Last active August 29, 2015 13:56
Default(Windows).sublime-keymap Key Bindings - User
[
{ "keys": ["ctrl+p"], "command": "duplicate_line" },
{ "keys": ["ctrl+e"], "command": "find_under_expand" },
{ "keys": ["alt+up"], "command": "swap_line_up" },
{ "keys": ["alt+down"], "command": "swap_line_down" },
{ "keys": ["shift+enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line.sublime-macro"} },
{ "keys": ["shift+ctrl+r"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
{ "keys": ["ctrl+d"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} }
]
@high5
high5 / gist:8935559
Created February 11, 2014 14:13
Preferences.sublime-settings Settings - User
{
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"highlight_line": true,
"color_scheme": "Packages/User/Monokai.tmTheme",
"font_size": 11.0,
"caret_style": "solid",
"caret_extra_width": 1,
//white space tab などを表示させるか
"draw_white_space": "selection",
"word_wrap": false,
@high5
high5 / sed_sample.sh
Last active August 29, 2015 14:04
$*_sed_pattern あるシェルスクリプトに渡された引数を加工して、さらに別のシェルスクリプトに引数として渡すパターン
#!/bin/sh
args=`echo "$*" | sed -e 's/ grpg/ htdocs\/grpg/g' -e 's/^grpg/htdocs\/grpg/g'`
./test2.sh $args
@high5
high5 / content_write.php
Created October 24, 2014 05:47
ファイル上書きの典型的パターン
$dest = dirname(__FILE__) . "/../config.php";
$content = <<<EOF
<?php
return array(
'flag' => 1,
);
EOF;
$fp = fopen($dest, 'w');
@high5
high5 / config
Created January 21, 2015 01:41
ssh config from github.com
Host github.com
Hostname github.com
User high5
Port 22
IdentityFile ~/.ssh/id_rsa
TCPKeepAlive yes
IdentitiesOnly yes
@high5
high5 / error-log
Created January 22, 2015 08:10
エラーログ中の全角の文字化けを回避
tail -f logs/error.log | perl -nle 's/\\x(..)/pack("C",hex($1))/eg;print $_'
@high5
high5 / mac-atom-keymap.cson
Last active August 29, 2015 14:14
Atom editor key bindings
# Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
# Here's an example taken from Atom's built-in keymap:
@high5
high5 / windows-atom-keymap.cson
Last active August 29, 2015 14:14
windows atom editor's keymap.cson
# Your keymap
#
# Atom keymaps work similarly to stylesheets. Just as stylesheets use selectors
# to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
# Here's an example taken from Atom's built-in keymap:
@high5
high5 / about-bower.md
Created February 4, 2015 02:24
about gist

bower

Bower

.bowerrc

{
 "directory": "js/bower_components",
@high5
high5 / TodoStore.js
Created March 13, 2015 03:00
ajax request sample
$.ajax({
async:false,
cache:false,
type: "POST",
url: "/todos",
data: { title: text}
})
.done(function(msg) {
var id = msg;
_todos[id] = {