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
initial version |
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 threading | |
from nose.tools import eq_ | |
import celery | |
from celery._state import _get_current_app | |
eq_('3.0.22', celery.__version__) | |
eq_('default', _get_current_app().main) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="./style.css"/> | |
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.1/underscore-min.js"></script> | |
</head> | |
<body> | |
<div class="form-group"> |
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 logging | |
from nose.plugins import logcapture | |
def iter_captured_logs(pluck=None): | |
handler = get_nose_log_handler() | |
# need to call `format` in order to let it compose the `message` attr for us | |
format = handler.format | |
for r in handler.buffer: | |
format(r) |
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
#!/bin/bash -e | |
# These need to be set. | |
#export EC2_HOME="/path/to/ec2-api-tools" | |
#export AWS_ACCESS_KEY='XXXXXXXXXXXXXXXXXXXX' | |
#export AWS_SECRET_KEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' | |
#export PATH="$PATH:${EC2_HOME}/bin" | |
ami_id='ami-123abc12' | |
availability_zone='eu-west-1a' | |
keypair="[email protected]" |
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 -*- | |
''' | |
Print some properties of members of your Mac AddressBook. | |
https://developer.apple.com/library/mac/documentation/userexperience/Reference/AddressBook/Miscellaneous/AddressBook_Constants/Reference/reference.html#//apple_ref/doc/uid/TP40003952-CH3g-SW6 | |
$ pip install -U pyobjc-core | |
$ pip install -U pyobjc | |
''' | |
from collections import OrderedDict | |
from Foundation import NSDate, NSDateFormatter |
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 cPickle as pickle | |
def pickle_recursively(obj, depth=0): | |
pad = ' ' * depth | |
if isinstance(obj, dict): | |
print pad, 'dict', obj.__class__ | |
for k, v in obj.iteritems(): | |
print pad, k | |
pickle_recursively(v, depth + 1) |
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 cPickle as pickle | |
from nose.tools import * | |
from celery import Celery | |
celery = Celery() | |
celery.conf.CELERY_ALWAYS_EAGER = True | |
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
sed -i 's/<ruby>\([^<]\+\)<rp>[^<]\+<\/rp><rt>[^<]\+<\/rt><rp>[^<]\+<\/rp><\/ruby>/\1/g' text/*.html |
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
# Local Variables: | |
# eval: (hi-lock-mode 1); | |
# eval: (unhighlight-regexp "^.*\\(?:^\\.\\).*$"); | |
# eval: (highlight-lines-matching-regexp "^\\." 'hi-yellow); | |
# eval: (text-scale-adjust 7); | |
# eval: (end-of-buffer); | |
# End: | |
------------------------------- | |