Skip to content

Instantly share code, notes, and snippets.

俺の 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 July 2, 2012 09:01
停電情報をpushするためのboxnyaプラグイン
# -*- 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 August 2, 2012 09:24
Boxnya plugin. mongodbと連携してTLのdeletedを通知するプラグイン.
# -*- coding: utf-8 -*-
from pymongo import Connection
from lib.core import Filter
class Deleted(Filter):
def init(self):
self.watch = [] # 監視対象のスクリーンネームを入れる. 空なら全部通知
addr = "localhost"
@non117
non117 / get_ancestor_dir.py
Created September 28, 2012 08:38
先祖path
# -*- coding: utf-8 -*-
import os
def get_ancestor_dir(path, n):
'''
pathからn階層上のディレクトリを返す
path: ディレクトリの文字列. os.path.abspath(__file__)とかを想定.
n: 遡る階層の数
return: パスの文字列
'''
#!/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 December 11, 2015 21:28
DPマッチングを計算するPythonのC++拡張.
#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 January 29, 2013 09:37
バターワースフィルタを設計して, LPFかけた信号を返してくれるえらいやつ
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 January 30, 2013 15:42
研究用ライブラリ
# -*- 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 December 14, 2015 06:49
SortedDictの機能をもった木構造のdict
>>> t = Tree()
>>> d = {}
>>> d["hoge"] = 1
>>> d["fuga"] = 2
>>> d["piyo"] = 3
>>> d
{'fuga': 2, 'piyo': 3, 'hoge': 1}
>>> t["a"]["b"]["hoge"]=1
&gt;&gt;&gt; t["a"]["b"]["fuga"]=2
@non117
non117 / api.py
Created May 12, 2013 14:45
tumblrのOAuthトークンを取得するだけのスクリプト
# -*- 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)