Skip to content

Instantly share code, notes, and snippets.

non117 non117

  • Kyoto
View GitHub Profile
View after_jailbreak.txt
俺の iPhone 4 (iOS 5.0.1) の JB 環境まとめ。とりあえず。
---
Sources
*Backspace Repos*
http://v.backspace.jp/repo/
*BigBoss*
http://apt.thebigboss.org/repofiles/cydia/dists/stable
@non117
non117 / teiden.py
Created Jul 2, 2012
停電情報をpushするためのboxnyaプラグイン
View teiden.py
# -*- coding: utf-8 -*-
import json
import urllib, urllib2
import time
from datetime import datetime
from lib.core import Input
class Teiden(Input):
def get_info(self):
@non117
non117 / deleted.py
Created Aug 2, 2012
Boxnya plugin. mongodbと連携してTLのdeletedを通知するプラグイン.
View deleted.py
# -*- coding: utf-8 -*-
from pymongo import Connection
from lib.core import Filter
class Deleted(Filter):
def init(self):
self.watch = [] # 監視対象のスクリーンネームを入れる. 空なら全部通知
addr = "localhost"
View get_ancestor_dir.py
# -*- coding: utf-8 -*-
import os
def get_ancestor_dir(path, n):
'''
pathからn階層上のディレクトリを返す
path: ディレクトリの文字列. os.path.abspath(__file__)とかを想定.
n: 遡る階層の数
return: パスの文字列
'''
View angelworm.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@non117
non117 / dtw.cpp
Last active Dec 11, 2015
DPマッチングを計算するPythonのC++拡張.
View dtw.cpp
#include<Python/Python.h>
#include<vector>
#include<map>
#include<queue>
#include<functional>
using namespace std;
struct Point{
short x,y;
@non117
non117 / lpf.py
Created Jan 29, 2013
バターワースフィルタを設計して, LPFかけた信号を返してくれるえらいやつ
View lpf.py
from scipy import signal
def lpf(x, cutoff_freq, samp_rate):
norm_pass = cutoff_freq/(samp_rate/2)
norm_stop = 1.5*norm_pass
N, Wn = signal.buttord(wp=norm_pass, ws=norm_stop, gpass=2, gstop=30, analog=0)
b, a = signal.butter(N, Wn, btype='low', analog=0, output='ba')
y = signal.lfilter(b, a, x)
return y
@non117
non117 / lib.py
Created Jan 30, 2013
研究用ライブラリ
View lib.py
# -*- coding: utf-8 -*-
import cPickle as pickle
import pylab
from mpl_toolkits.mplot3d.axes3d import Axes3D
from numpy import arange, sqrt, cos, sin, matrix, identity, pi
from scipy import signal
from scipy.interpolate import UnivariateSpline
def squarediff(x, y):
@non117
non117 / test.md
Last active Dec 14, 2015
SortedDictの機能をもった木構造のdict
View test.md
>>> t = Tree()
>>> d = {}
>>> d["hoge"] = 1
>>> d["fuga"] = 2
>>> d["piyo"] = 3
>>> d
{'fuga': 2, 'piyo': 3, 'hoge': 1}
>>> t["a"]["b"]["hoge"]=1
>>> t["a"]["b"]["fuga"]=2
@non117
non117 / api.py
Created May 12, 2013
tumblrのOAuthトークンを取得するだけのスクリプト
View api.py
# -*- coding: utf-8 -*-
import urllib, urllib2
from oauth import OAuth
class Api():
def __init__(self, atoken="", atokensecret="", ckey="", csecret="", hostname=""):
self.oauth = OAuth(ckey, csecret, atoken, atokensecret)
self.site = "http://api.tumblr.com/v2/blog/%s/" % (hostname)
You can’t perform that action at this time.