Skip to content

Instantly share code, notes, and snippets.

View ghiden's full-sized avatar

Hidenari Nozaki ghiden

View GitHub Profile
@ghiden
ghiden / D3-Grouping-Elements.markdown
Created September 16, 2013 09:40
A Pen by Hidenari Nozaki.
HTML Font Size mapping
1: < 12px
2: < 15px
3: < 17px
4: < 21px
5: < 28px
6: < 40px
7: >= 40px
@ghiden
ghiden / gitconfig
Created February 18, 2013 02:13
git config
[user]
name = ...
email = YOUR@EMAIL.COM
[core]
autocrlf = input
safecrlf = true
[alias]
co = checkout
ci = commit
st = status
@ghiden
ghiden / mine.zsh-theme
Last active October 10, 2015 08:48
oh-my-zsh prompt with rbenv version along with git stuff
function ruby_version() {
echo `rbenv version | sed -e 's/ .*//'`
}
PROMPT='%{$fg[yellow]%}$(ruby_version)%{$fg[yellow]%} %{$fg_bold[red]%}➜ %{$fg_bold[green]%}%~ %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}
$ '
ZSH_THEME_GIT_PROMPT_PREFIX="[%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}] %{$fg[yellow]%}✗%{$reset_color%}"
@ghiden
ghiden / open-starred-n-unstar-em.py
Created April 27, 2012 13:13
Open Google Reader's Starred items in browser
#!/usr/bin/env python
import sys
import gdata.service
import subprocess
import getpass
import urllib
import re
import os
import ConfigParser
@ghiden
ghiden / schedule.rb
Created March 28, 2012 06:09
specifying which day for "Whenever" gem
#https://github.com/javan/whenever
set :output, "#{path}/logs/cron.log"
every [:sunday, :monday, :tuesday, :wednesday, :thursday], :at => "15:50" do
command "ruby #{path}/something.rb"
end
@ghiden
ghiden / amqp_consumer.rb
Created January 20, 2012 08:16
ruby and node.js message exchange via rabbitmq
require 'amqp'
EventMachine.run do
connection = AMQP.connect(:host => '127.0.0.1', :username => 'guest', :password => 'guest')
puts "Connecting to AMQP broker. Running #{AMQP::VERSION} version of the gem..."
channel = AMQP::Channel.new(connection)
queue = channel.queue("rubyqueue", :auto_delete => true)
exchange = channel.default_exchange
@ghiden
ghiden / chromeThis
Created November 18, 2011 06:38
from Safari, open this page in Chrome
property theURL : ""
tell application "Safari"
set theURL to URL of current tab of window 1
end tell
tell application "Google Chrome"
if not (window 1 exists) then
make new window
end if
@ghiden
ghiden / test.js
Created June 22, 2011 04:51
sending a message to specific clients with socket.io
/* just a snippet */
var client_ids = [a, b, c];
for (var cid in client_ids) {
socket.clients[client_ids[cid]].send('hello');
}
@ghiden
ghiden / demo.P
Created October 28, 2010 01:48
A fix for the examples from JPL prolog java binding http://www.swi-prolog.org/packages/jpl/java_api/getting_started.html
Variable X = new Variable("X");
Query q4 =
new Query(
"descendent_of",
new Term[] {X,new Atom("ralf")}
);
java.util.Hashtable solution;
solution = q4.oneSolution();