Skip to content

Instantly share code, notes, and snippets.

View hirokiky's full-sized avatar

Hiroki Kiyohara hirokiky

View GitHub Profile
@knzm
knzm / traversal.py
Last active December 15, 2015 01:48
from wsgiref.simple_server import make_server
from webob.dec import wsgify
class Traverser(object):
def __init__(self, root):
self.root = root
@wsgify
def __call__(self, request):
#!/usr/bin/python
# -*- coding: utf-8 -*-
import socket
from time import sleep
commands = {}
def command(registry):
def wrapper(func):
def _chunker(it):
while True:
yield (it.next(), it.next())
def chunker(seq):
return map(list, _chunker(iter(seq)))
import unittest
@podhmo
podhmo / fizzbuzz.py
Created August 30, 2013 09:24
1つの式〜
# -*- coding:utf-8 -*-
from __future__ import print_function
(lambda zero, one, succ, is_zero, pred, AND, IF, Y, undefined:
(lambda add, mul, sub:
(lambda GT, EQ:
(lambda rem, REP:
(lambda three, five,num_from_church:
(lambda fifteen, one_hundred:
(lambda fizzbuzz:
@hgomez
hgomez / mint141516.md
Last active December 29, 2024 11:26
Mint 14 -> Mint 15 -> Mint 16

Mint upgrade procedures

Some investigation and tests on how to upgrade Mint machine.

Tests performed on Mint Cinnamon 14/15/16, on physical machine 14->15 and VirtualBox VMs for 14->15->16 and 14->16.

As usual you could break your machine, so please do backups before and cross fingers.

Mint 14 -> Mint 15

# In mymodule.py
from zope.proxy import ProxyBase, setProxiedObject
hoge = ProxyBase(None)
def setup_hoge():
setProxiedObject(hoge, 'hoge')
@voluntas
voluntas / mqtt.rst
Last active February 16, 2018 00:03
MQTT コトハジメ

MQTT コトハジメ

更新:2014-05-14
バージョン:0.0.12
作者:@voluntas
URL:http://voluntas.github.io/

とても詳しいまとめがありますので、ますはそちらを見ることをオススメします。

@aodag
aodag / app.py
Created May 15, 2014 17:35
aiohttpとaiopgを使ってasync web+dbアプリケーション
# -*- coding:utf-8 -*-
import io
import argparse
import asyncio
import aiopg
import sqlalchemy as sa
import webob
from aiopg.sa import create_engine
from aiohttp.wsgi import WSGIServerHttpProtocol
from webdispatch import URLDispatcher, MethodDispatcher
# -*- coding:utf-8 -*-
import pkg_resources
from collections import defaultdict
def add_rdependencies(d, result):
for r in d.requires():
result[r.project_name.lower()].add(d)
  • 🎨 when improving the format/structure of the code
  • 🚀 when improving performance
  • ✏️ when writing docs
  • 💡 new idea
  • 🚧 work in progress
  • ➕ when adding feature
  • ➖ when removing feature
  • 🔈 when adding logging
  • 🔇 when reducing logging
  • 🐛 when fixing a bug