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
$ pip freeze | |
Jinja2==2.7 | |
MarkupSafe==0.18 | |
Pygments==1.6 | |
Sphinx==1.2b1 | |
Tinkerer==1.2 | |
argparse==1.2.1 | |
distribute==0.6.31 | |
docutils==0.10 | |
wsgiref==0.1.2 |
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
** Unknown exception encountered with possibly-broken third-party extension hgshelve | |
** which supports versions unknown of Mercurial. | |
** Please disable hgshelve and try your action again. | |
** If that fixes the bug please report it to the extension author. | |
** Python 2.7.3 (default, Aug 1 2012, 05:16:07) [GCC 4.6.3] | |
** Mercurial Distributed SCM (version 2.6-rc) | |
** Extensions loaded: color, eol, convert, extdiff, hgshelve, histedit, info, mq, pager, progress, purge, rebase, record, schemes, transplant, hgflow | |
Traceback (most recent call last): | |
File "/usr/local/bin/hg", line 38, in <module> | |
mercurial.dispatch.run() |
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 csv | |
import requests | |
from pyquery import PyQuery as pq | |
def _scrape_links(url, search_query): | |
response = requests.get(url, params=search_query) |
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
(function($) { | |
// element の true/false に対して control の true/false が追従します | |
$.fn.toggle_chkboxes = function(control) { | |
var element = this; | |
control = $(control); | |
// element がクリックされたら change.chkboxes イベントを発火させる | |
element.click(function() { |
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 sys | |
def warning(ui, repo, hooktype, node=None, source=None, **kwargs): | |
ctx = repo[None] | |
unknown_files = repo.status(ctx.parents()[0], ctx, unknown=True)[4] | |
if unknown_files: | |
for filename in unknown_files: |
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 -*- | |
from functools import wraps | |
from django.contrib import messages | |
from django.shortcuts import redirect | |
def session_required(session_key, fail_redirect_to): | |
def _session_required(view_func): | |
@wraps(view_func) |
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
>>> from celery.beat import ScheduleEntry | |
>>> from celery.task import periodic_task | |
>>> from celery.schedules import crontab | |
>>> from some_module import some_function | |
>>> entry = ScheduleEntry(periodic_task(mkdir_every_minute, run_every=crontab())) | |
>>> entry | |
<Entry: <function _create_task_cls at 0xb0156f4> None(*(), **{}) {None}> |
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 -*- | |
# アルファベットから顔文字生成 | |
# Python3専用です | |
import unicodedata | |
def to_face(ls): | |
for c in ls: |