Skip to content

Instantly share code, notes, and snippets.

View hnagato's full-sized avatar

nagato hnagato

  • Japan
View GitHub Profile
@hnagato
hnagato / safari_user.css
Created September 29, 2010 05:03
UserCSS - Safari
@namespace url(http://www.w3.org/1999/xhtml);
@charset "utf-8"
/*
* textarea をリサイズ可能にしとく
*/
textarea {
resize: both !important;
}
@hnagato
hnagato / DefaultKeyBinding.dict
Last active February 19, 2018 09:28
Cocoaのキーバインドをよりemacsに近づける
/* ~/Library/KeyBindings/DefaultKeyBinding.dict */
{
/* Auto-Paring */
// "(" = ( "insertText:", "()", "moveBackward:" );
// "{" = ( "insertText:", "{}", "moveBackward:" );
// "[" = ( "insertText:", "[]", "moveBackward:" );
"~f" = "moveWordForward:"; /* M-f */
"~b" = "moveWordBackward:"; /* M-b */
"~<" = "moveToBeginningOfDocument:"; /* M-< */
# source: http://d.hatena.ne.jp/umezo/20100508/1273332857
local COMMAND=""
local COMMAND_TIME=""
function _growl_lazy_precmd() {
if [ "$COMMAND_TIME" -ne "0" ] ; then
local d=`date +%s`
d=`expr $d - $COMMAND_TIME`
if [ "$d" -ge "5" ] ; then
COMMAND="$COMMAND "
growlnotify -t "${${(s: :)COMMAND}[1]}" -m "$COMMAND"
@hnagato
hnagato / hackernews.user.css
Created January 21, 2011 19:28
Hacker News の文字小さい…
@charset "utf-8";
/*
* Hacker News - http://news.ycombinator.com/news
*/
.title {
font-size: 16px !important;
}
.subtext {
font-size: 12px !important;
#!/bin/bash
parallel -k -j+0 brew install {} ::: `brew outdated | cut -f 1` && brew cleanup
<?xml version="1.0"?>
<root>
<list>
<item>
<name>LeaveInsMode with EISUU(Terminal)</name>
<identifier>private.app_terminal_esc_with_eisuu</identifier>
<only>TERMINAL</only>
<autogen>--KeyToKey-- KeyCode::ESCAPE, KeyCode::ESCAPE, KeyCode::JIS_EISUU</autogen>
<autogen>--KeyToKey-- KeyCode::BRACKET_LEFT, VK_CONTROL, KeyCode::BRACKET_LEFT, VK_CONTROL, KeyCode::JIS_EISUU</autogen>
</item>
@hnagato
hnagato / output256_location.rb
Created February 21, 2012 06:31
location 表示 + screen_name をもうちょいカラフルに
# -*- coding: utf-8 -*-
module Earthquake
module Output
require 'uri'
def puts_items(items)
mark_color = [ config[:colors].sample, 1 ].flatten # random & bold
[items].flatten.reverse_each do |item|
@hnagato
hnagato / brew-rbenv-2012-03-01.sh
Created March 1, 2012 09:14
Install ruby with homebrew, rbenv and ruby-build on OSX 10.7
# Install rbenv, ruby-build and readline
brew install rbenv ruby-build readline
brew link readline
# Add rbenv init to .zshenv
cat <<-EOF | ruby -pe 'gsub("\\", "")' >> .zshenv
# rbenv
if which rbenv >/dev/null 2>&1; then
eval "$\(rbenv init -\)"
source /usr/local/Cellar/rbenv/0.3.0/completions/rbenv.zsh
#!/bin/bash
find . -type d -depth 1 ! -name gists |
parallel -k -j 1000% 'cd {}; echo \[{}\]; git st --short'
Number.format = function(n) {
return String(n).replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");
};