Skip to content

Instantly share code, notes, and snippets.

View shogo82148's full-sized avatar
🏠
Working from home

ICHINOSE Shogo shogo82148

🏠
Working from home
View GitHub Profile
@shogo82148
shogo82148 / auth.py
Created January 1, 2012 02:55
ただツイートするだけのスクリプト
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import tweepy
if __name__ == "__main__":
consumer_key = 'Your Consumer Key'
consumer_secret = 'Your Consumer Secret'
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
@shogo82148
shogo82148 / facebookpost.py
Created January 1, 2012 03:02
Facebookにポストするスクリプト
#!/usr/local/bin/python2.6
#-*- coding:utf-8 -*-
import facebook
import cgi
import urllib
import sys
import codecs
sys.stdin = codecs.getreader('utf-8')(sys.stdin)
sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
@shogo82148
shogo82148 / report.tex
Created January 1, 2012 04:54
レポートとかに使うTeXのテンプレート
\documentclass[a4paper,11pt]{jsarticle}
\usepackage{amsmath,amssymb}
\usepackage{bm}
\usepackage[dvips]{graphicx}
%テキストの表示領域の調節
\setlength{\textwidth}{\paperwidth}
\addtolength{\textwidth}{-40truemm}
\setlength{\textheight}{\paperheight}
\addtolength{\textheight}{-45truemm}
@shogo82148
shogo82148 / TakePicBot.py
Created January 9, 2012 11:36
A bot taking a picture in sl4a
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import tweepy
import codecs
import sys
import threading
import time
import android
@shogo82148
shogo82148 / Zenkaku2Hankaku.user.js
Created January 10, 2012 09:55
すべての全角アルファベットを半角に
// ==UserScript==
// @name Zenkaku2Hankaku.js
// @namespace http://github.com/shogo82148/
// @description すべての全角アルファベットを半角に
// @include *
// ==/UserScript==
(function() {
Zen2Han = {
"A":"A",
"B":"B",
@shogo82148
shogo82148 / status2time
Created January 11, 2012 04:20
Convert Twitter Status ID to Date and Time
import time
status_id = int(raw_input('input status id:'))
timestamp = (status_id>>22) + 1288834974657
print time.ctime(timestamp/1000)
@shogo82148
shogo82148 / igo-0.4.4-fix.patch
Created February 25, 2012 13:14
A Patch that fixes the matrix file of Igo
Index: igo/src/net/reduls/igo/dictionary/build/Matrix.java
===================================================================
--- igo/src/net/reduls/igo/dictionary/build/Matrix.java (リビジョン 107)
+++ igo/src/net/reduls/igo/dictionary/build/Matrix.java (作業コピー)
@@ -21,33 +21,33 @@
public static void build(String inputDir, String outputDir) throws ParseException, IOException {
final ReadLine rl = new ReadLine(inputDir+"/matrix.def", "UTF-8");
try {
- // 一行目はサイズ: [左文脈IDの数] [右文脈IDの数]
+ // 一行目はサイズ: [右文脈IDの数] [左文脈IDの数]
@shogo82148
shogo82148 / counter.py
Created April 26, 2012 01:51
FUCOROIDフォローカウンター
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import config
from TwitterBot import BaseBot
import logging
logger = logging.getLogger("Bot.counter")
class Bot(BaseBot):
@shogo82148
shogo82148 / extactAttach.py
Created May 8, 2012 06:32
pukiwiki2mediawiki converter
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
from struct import *
import glob
import os
import datetime
import locale
import shutil
@shogo82148
shogo82148 / gist:2642622
Created May 9, 2012 07:15
切なぃ恋ダウンローダ
import urllib2
import json
api = "http://estar.jp/api/get_novel_page_info?_=1336547125896&w=13428686&p=%d"
for i in range(1, 122):
url = api % i
res = urllib2.urlopen(url)
data = json.load(res)
print "Page:", i