View amazon-calc.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Amazonの注文履歴をTSV形式で出力するスクリプト | |
// | |
// 2015-01-01 時点での DOM 構造に対応, GoogleCrome, Opera でテスト済。 | |
// formatEntry関数を書き換えれば自由な書式で出力できます。 | |
// | |
// 参考: | |
// - Amazonの注文履歴をCSV形式にして出力するスクリプト | |
// https://gist.github.com/arcatdmz/8500521 | |
// - Amazon で使った金額の合計を出す奴 (2014 年バージョン) | |
// https://gist.github.com/polamjag/866a8af775c44b3c1a6d |
View jj2.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding:utf8 -*- | |
import sys, optparse | |
import jinja2 | |
def main(args, params): | |
encoding = params.encoding | |
tpl = jinja2.Template(sys.stdin.read().decode(encoding)) | |
param = dict() | |
ex_args = list() |
View gist:76455b2511e18ce9237a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ls | perl -pe 's/([aiueo])/\1\1\1/ig;s/$/!!!/' |
View serialize_sparse_matricies.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import scipy.sparse as sps | |
import numpy as np | |
from StringIO import StringIO | |
def _np_savez(compressed=False, *args, **kwds): | |
sio = StringIO() | |
if compressed: | |
np.savez_compressed(sio, *args, **kwds) | |
else: |
View sqlite-ex.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
import sqlite3 | |
import numpy as np | |
class Median: | |
def __init__(self): | |
self.values = [] | |
def step(self, value): | |
self.values.append(value) |
View tty-exec.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import subprocess, pty, os, sys | |
def _safe_read(m): | |
try: | |
return os.fdopen(m,"r").read() | |
except IOError: | |
return '' | |
sout_m, sout_s = pty.openpty() |
View fillram.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <unistd.h> | |
void main(){ | |
while(malloc(100*1024*1024)); | |
while(1)sleep(60); | |
} |
View jupyter-headers.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%matplotlib inline | |
import matplotlib.pyplot as plt | |
plt.rcParams["figure.figsize"] = (10, 6) | |
import pandas as pd | |
import numpy as np |
View RecommendationApiParamSearch.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import time | |
import json | |
class AzureReco: | |
BASE_URL = 'https://westus.api.cognitive.microsoft.com/recommendations/v4.0' | |
def __init__(self, subscription_key): | |
self._subscription_key = subscription_key |
View .screenrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
escape ^Tx | |
bind n eval 'next' | |
bind p eval 'prev' | |
defscrollback 10000 | |
# enable 256 color | |
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' | |
# don't resize terminal width when re-attached. |
OlderNewer