Skip to content

Instantly share code, notes, and snippets.

View minamorl's full-sized avatar

minamorl minamorl

  • CureApp, Inc
  • Tokyo, Japan
  • 05:24 (UTC +09:00)
View GitHub Profile
map h previousTab
map l nextTab
map d removeTab
map u restoreTab
map <C-d> scrollPageDown
map <C-u> scrollPageUp
[pytest]
norecursedirs=venv .* _build tmp*
@minamorl
minamorl / wtf.py
Last active December 12, 2015 12:51
import inspect
exec("def init{type}: self.__dict__.update(dict((str(x), y) for x, y in zip(inspect.signature(init).parameters.values() , {type})))".format(type=inspect.signature(lambda self, a, b: None)), locals())
types = str(inspect.signature(lambda self, a, b: None))
assert types == "(self, a, b)"
class K: pass
K.__init__ = init
index {
print("function `index` is called")
}
main {
print("function `main` is called")
}
# =========>
# Same as:
class MetaData(type):
def __new__(mcs, name, bases, attrs):
for a in attrs:
# Ignore magic names
if a.startswith("_"):
continue
print(a)
return super().__new__(mcs, name, bases, attrs)
@minamorl
minamorl / delete_all_tweets_from_csv.py
Last active March 7, 2016 18:58
Simple script to delete all tweets from provided CSV file.
import staccato
import os
import configparser
import csv
import redis
import sys
def import_configurations(path="~/.staccato.conf"):
"""Import oauth1 settings via configparser."""
import os
context = list()
def run(arg):
context[-1].run(arg)
class Context:
@minamorl
minamorl / autofollow.py
Last active July 27, 2016 04:53
gistに直接気持ちで書いたので動くか知らない
import staccato
import time
# must be replaced
consumer_key = "YOURS"
consumer_secret = "YOURS"
access_token_key = "YOURS"
access_token_secret = "YOURS"
TARGET = "username"
SLEEP_TIME = 5
@minamorl
minamorl / package.json
Created February 3, 2017 16:43
My package json
{
...
"author": "minamorl",
"license": "MIT",
"dependencies": {
"@types/bcrypt": "^1.0.0",
"@types/body-parser": "0.0.33",
"@types/bookshelf": "^0.8.34",
"@types/cookie-parser": "^1.3.30",
"@types/cors": "^2.8.0",
@minamorl
minamorl / xml-ebnf-names.txt
Created February 2, 2018 11:51
XML ebnf names
// Prolog
prolog
xmldecl
versioninfo
eq
versionnum
misc
// Document Type Definition
doctypedecl