Skip to content

Instantly share code, notes, and snippets.

@orangain
orangain / valid_meshcodes.geojson
Last active September 25, 2015 11:30
Valid Meshcodes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@orangain
orangain / 01_setup.sh
Last active January 22, 2016 02:46 — forked from krak3n/.zshrc
Mac OS X script to automatically start boot2docker on system boot
curl https://gist.github.com/orangain/5f74bf388f66778f0e47/raw/com.docker.boot2docker.plist -o ~/Library/LaunchAgents/com.docker.boot2docker.plist
launchctl load ~/Library/LaunchAgents/com.docker.boot2docker.plist
echo '$(boot2docker shellinit)' >> ~/.bash_profile
irb(main):003:0> require 'time'
=> true
irb(main):008:0> Time.strptime("2014-02-06T11:20:16.898", '%Y-%m-%dT%H:%M:%S')
=> 2014-02-06 11:20:16 +0900
irb(main):009:0> Time.strptime("2014-02-06T11:20:16Z", '%Y-%m-%dT%H:%M:%S%z')
=> 2014-02-06 11:20:16 UTC
irb(main):010:0> Time.strptime("2014-02-06T11:20:16.898Z", '%Y-%m-%dT%H:%M:%S%z')
ArgumentError: invalid strptime format - `%Y-%m-%dT%H:%M:%S%z'
from /Users/orange/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/time.rb:394:in `strptime'
from (irb):10
@orangain
orangain / lxc_ubuntu_bootstrap.sh
Last active December 17, 2015 23:58
LXC container's bootstrapping code.
#!/bin/sh
set -x
# Additional packages
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y language-pack-en curl wget git dnsutils unattended-upgrades
# Locale
@orangain
orangain / skype
Last active December 14, 2015 03:09 — forked from moriyoshi/launch-skype.sh
/etc/init.d/skype for Ubuntu Server 12.04.2 LTS
#!/bin/bash
#
# Init file for daemonized Skype service
#
### BEGIN INIT INFO
# Provides: skype
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
@orangain
orangain / 1. Kinect-FHCに事業仕分けを聞かせてみた.md
Last active December 13, 2015 20:38
Kinect-FHCに事業仕分けを聞かせてみたときのログ
@orangain
orangain / Gemfile
Created November 12, 2012 12:38 — forked from pete-otaqui/Gemfile
Capybara, Cucumber, Webdriver, Mechanize and SauceLabs ... whew!
source "http://rubygems.org"
gem "cucumber"
gem "capybara"
gem "capybara-webkit", :platforms => [:ruby], :require => false, :git => "git://github.com/thoughtbot/capybara-webkit.git"
gem "capybara-mechanize", :git => "git://github.com/jeroenvandijk/capybara-mechanize.git"
gem "rspec"
gem "rake"
@orangain
orangain / nishinomiya_reservation.user.js
Created May 27, 2012 09:12
西宮市市民交流センター予約ページの改良
// ==UserScript==
// @name 西宮市市民交流センター予約ページの改良
// @namespace capybala.com
// @description
// @include http://nnpo.or.jp/rsv/calendar_all.cgi*
// ==/UserScript==
var getElementsByXPath = function(expression, parentElement) {
var r = []
#coding: utf-8
from itertools import permutations
operators = ('+', '-', '*', '/', '==')
for ordered_operators in permutations(operators):
equation = '5.%s4.%s3.%s2.%s1.%s0.' % ordered_operators
try:
if eval(equation):
print equation
@orangain
orangain / link_to_stack_overflow.user.js
Created January 31, 2011 08:00
A greasemonkey script to replace a link to copy site of Stack Overflow with a link to the original page