Skip to content

Instantly share code, notes, and snippets.

@wasabi0522
wasabi0522 / darsana_lottery.py
Last active August 29, 2015 14:11
Darsana Anker lottery
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from __future__ import print_function
import sys
import random
import time
import csv
import datetime
import time
import math
import functools
def printspec(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
sttime = time.time()
# print func(*args, **kwargs)
func(*args, **kwargs)
@wasabi0522
wasabi0522 / tags.py
Last active December 27, 2015 07:19
#!/usr/bin/env python
# require python3.1 or later and requests package
# this script print boxen package list with the latest version
# for example
# $ python tags.py
# puppet-adium 1.2.0
# puppet-adobe_reader 1.1.0
# puppet-airfoil 0.0.1
# puppet-alfred 1.1.6
# puppet-android 1.0.0
#################################################################################
## .tmux.conf
## reference
## 1. http://d.hatena.ne.jp/mizchi/20100829/1283076112
## 2. http://blog.goo.ne.jp/ebgp/e/4fe5c4ed53b2f7fb41835c4e1bcbb82c
## 3. http://dev.gentoo.org/~wired/conf/tmux.conf
#################################################################################
## status bar theme
## ステータス行の書式
# (コマンド行) コマンド出力の最初の行
@wasabi0522
wasabi0522 / gist:3486387
Created August 27, 2012 07:05
Please fix the bug of group photo album @facebook
Hi Facebook support team,
I am Masahiro KIURA, Japanese facebook user.
I would like to submit the bug of facebook group feature to you.
Background
I uploaded about 200 photos as following group album to the following group that I am managing.
Group: <GROUP URL>
Group album: <GROUP PHOTO ALBUM URL>
@wasabi0522
wasabi0522 / gist:1273721
Created October 9, 2011 14:06
flaskr/__init__.py
from flask import Flask, request, g, url_for
from flaskext.sqlalchemy import SQLAlchemy
import config
from flaskr.util.db import db
app = Flask(__name__)
app.config.from_object(config)
app.static_path = '/static'
db.init_app(app)
@wasabi0522
wasabi0522 / threadtest.py
Created September 15, 2011 14:22
isAlive test
import threading
import time
class subThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.setDaemon(True)
print "================= sub Listened"
def run(self):
#!/bin/env python
# require python 2.x
# usage: zipdirs.py <targetdirname>
# $ cd ; zipdirs.py ~/hoge
# $ cd hoge ; ls
# fuga/
# fuga.zip
# piyo/
#!/bin/env python
# require python 2.x
# usage: zipdir.py <dirname>
import sys
import os
import zipfile
# dirname: archive target