Skip to content

Instantly share code, notes, and snippets.

@orangain
orangain / 0_reuse_code.js
Created January 13, 2016 14:05
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# coding: utf-8
from __future__ import print_function
import scrapy
class TestSpider(scrapy.Spider):
name = 'test'
allowed_domains = ['capybala.com']
start_urls = (
@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 = []
@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.
#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_appbrain.user.js
Created December 21, 2010 17:43
A greasemonkey script to replace a link to Android Market with a link to AppBrain