Skip to content

Instantly share code, notes, and snippets.

@Arthraim
Arthraim / bottle_example.py
Created May 27, 2011 04:27
a python web framework bottle's example
#coding: utf-8
from bottle import route, error, post, get, run, static_file, abort, redirect, response, request, template
@route('/')
@route('/index.html')
def index():
return '<a href="/hello">Go to Hello World page</a>'
@route('/hello')
def hello():
@sgk
sgk / trac2down.py
Created October 14, 2011 09:35
Trac Wiki to Markdown converter
#!/usr/bin/python
# vim:set fileencoding=utf-8 sw=2 ai:
import sqlite3
import datetime
import re
SQL = '''
select
name, version, time, author, text
tracking_id = "hitoriblog0c-22";
pf = "http://www.amazon.co.jp/exec/obidos/ASIN/";
d = document;
u = d.location.href;
re = new RegExp("^http://www.amazon.co.jp/gp/aw/d/([0-9A-Z]{10})");
res = u.match(re);
if (res) {
asin = res[1];
afurl = pf + asin + "/" + tracking_id + "/ref=nosim/";
tmp = d.evaluate('//div[@class="dpProductTitle"]', d, null, 7, null).snapshotItem(0);
@moyashi
moyashi / gist:1397733
Created November 27, 2011 16:04
ebook_msc name PRS-T1 info
C:\minimal-root-jp>ebook_msc name PRS-T1 info
Sony Reader MSC utility 1.06 (c) 2009 Igor Skochinsky, Vladimir Boroda
avail: 0
openDrive [\\.\F:]: 1
usbInitCheck: 0
USB protocol versions:0 (?): 01000000
1 (Device): 01000010
2 (Updater):00000000
3 (?): 01000000
UsbGetDevProperty: 0
@novi
novi / gist:1631319
Created January 18, 2012 05:50
Arch LinuxをMacBook Air 3,2のSDカードにインストールメモ

Arch LinuxをMacBook Air 3,2のSDカードにインストールメモ

Bootcampの領域を壊さずに内蔵SDカードリーダーのSDメモリへインストールしてみた。

パーティション

  • /dev/disk0s1: EFIシステム
  • /dev/disk0s2: HFS+ OS X Lion (rEFItをインストール済)
  • /dev/disk0s3: Recovery (OS X Lion)
  • /dev/disk0s4: Windows 7
@Shinichi-Ohki
Shinichi-Ohki / version_identifer_test.ulp
Last active October 6, 2015 06:38
Identify Eagle version in your ULP. (ULPからEAGLEのバージョンを知る方法)
CadsoftのEagleでは、ユーザープログラム(User Language Program,ULP)内で#requireディレクティブを使うことにより、ULPの動作するEagleのバージョンを制限することができます。
EagleのバージョンごとにULPの動作を変えたいときなどにバージョン番号が必要となるため、取得する方法を載せておきます。
定数EAGLE_VERSION、EAGLE_RELEASE、EAGLE_SIGNATUREを参照して文字列を作り、ダイアログボックスに表示します。
Eagleが提供している組み込み定数の詳細はulpマニュアル(ulp640_en.pdf.pdf)の67ページ以降(Builtin Constantsの章)を参照してください。
@sgk
sgk / job.sh
Created June 25, 2012 17:04
Simple backup script
#!/bin/sh
export PATH=/usr/sbin:/sbin:$PATH
export TZ=Asia/Tokyo
export LANG=en
SERVERHOST=mybackupserver.example.com
SERVERLOGIN=mybackup
SERVER="$SERVERLOGIN@$SERVERHOST"
WEEKDAY=$(date +%a)
@ponkore
ponkore / memo.sh
Created August 3, 2012 05:19
github上でgithubにフォークしたリモートリポジトリを本家リモートリポジトリに追随する
# http://d.hatena.ne.jp/haru-s/20110405/1302006637 に答えがそのままあるが、一応メモ
# github fork 追従 で見つけた
$ git remote
origin
# 本家のリモートリポジトリの短縮名を登録する.
$ git remote add github git://github.com/liquidz/misaki.git
# 本家の更新をローカルで反映させる.
@zenorocha
zenorocha / README.md
Last active May 28, 2024 08:23
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@sgk
sgk / ir_send.ino
Last active December 11, 2015 10:19 — forked from ytsuboi/ir_send.ino
/*
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2013 Yoshihiro TSUBOI <ytsuboi-at-gmail.com>
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
#