This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
require 'rubygems' | |
require 'open-uri' | |
require 'logger' | |
require 'yaml' | |
IP_REG_EXP = /^(\d|[01]?\d\d|2[0-4]\d|25[0-5])\.(\d|[01]?\d\d|2[0-4]\d|25[0-5])\.(\d|[01]?\d\d|2[0-4]\d|25[0-5])\.(\d|[01]?\d\d|2[0-4]\d|25[0-5])$/ | |
CURRENT_DIR = "#{File.dirname(File.expand_path(__FILE__))}/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os, shutil, glob, commands | |
dropbox_dir = os.path.expanduser('~/dropbox') | |
airvideo_dir = '/var/airvideo' | |
dropbox_script_path = dropbox_dir + "/bin/dropbox" | |
monitering_dirs = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; growl | |
(setq growl-program "/usr/local/bin/growlnotify") | |
(defun growl (title message &optional app) | |
(start-process "Growl" "*Growl*" growl-program | |
"-t" title | |
"-m" message | |
"-a" app)) | |
;; twittering mode | |
;; (install-elisp "http://github.com/hayamiz/twittering-mode/raw/master/twittering-mode.el") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var d = document; | |
var b = d.body; | |
var link = d.createElement('a'); | |
var link.appendChild(d.createTextNode('google')); | |
link.href = 'http://google.com'; | |
b.appendChild(link); | |
var link2 = '<a href="http://google.com">google</a>'; | |
b.innerHTML += link2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package jp.mituliii.hardwarekeysupportsample; | |
public enum HKKeyCodeMap | |
{ | |
KEYCODE_UNKNOWN ("UNKNOWN", 0), | |
KEYCODE_SOFT_LEFT ("SOFT_LEFT", 1), | |
KEYCODE_SOFT_RIGHT ("SOFT_RIGHT", 2), | |
KEYCODE_HOME ("HOME", 3), | |
KEYCODE_BACK ("BACK", 4), | |
KEYCODE_CALL ("CALL", 5), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pp = function(object, offset) | |
{ | |
var indent = ' '; | |
offset = offset || ''; | |
var output = ''; | |
if (object.constructor === Array) { | |
output += '[\n'; | |
for (var i = 0, len = object.length; i < len; i += 1) { | |
output += offset + indent; | |
output += pp(object[i], offset + indent); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fib = function(n) { | |
if (n > 1) { | |
return fib(n-2) + fib(n-1); | |
} else { | |
return 1; | |
} | |
}; | |
window.addEventListener('load', function() { | |
var buttons = document.querySelectorAll('button'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var addTrackToLink = function() { | |
var anchor = new RegExp(location.href + "#.*?"); | |
var js = /^javascript\:/; | |
return function(link) { | |
var handler = link.readAttribute('onclick'); | |
var href = link.href; | |
if (handler === null && !anchor.test(href) && !js.test(href)) { | |
var action = href.match(/http?:\/\/([^\/]+)\//)[1]; | |
link.writeAttribute('onclick', "javascript:_gaq.push(['_trackEvent', 'outbound-article', '" + action + "'])"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
gmail = ARGV[0] | |
unless gmail | |
puts "Usage: ruby growl_reeder.rb [gmail]" | |
exit | |
end | |
require 'rubygems' | |
require 'tempfile' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Clearfix */ | |
.clearfix:after { | |
content: "."; | |
display: block; | |
clear: both; | |
height: 0; | |
visibility: hidden; | |
} | |
.clearfix { |