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 | |
S3_BUCKET=$1 | |
S3_OBJECT=$2 | |
S3CFG=S3-CONFIG-FILE | |
S3CMD="s3cmd -c $S3CFG" | |
TIMESTAMP=$((`date +%s` + 600)) | |
can_string="GET\n\n\n${TIMESTAMP}\n/${S3_BUCKET}/${S3_OBJECT}" | |
# generate the signature |
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
// ==UserScript== | |
// @name MouseHunt Horn bot | |
// @namespace adachinko | |
// @include http://apps.facebook.com/mousehunt/index.php | |
// @include http://apps.facebook.com/mousehunt/ | |
// ==/UserScript== | |
(function() { | |
function getFirstElementByXPath(xpath, node) { | |
var node = node || document |
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 sys | |
import time | |
import traceback | |
import select | |
from eventlet.support import greenlets as greenlet | |
from eventlet.hubs.hub import BaseHub, FdListener, READ, WRITE | |
WAIT_TIMER_INDENT = 0x10001234 |
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 select, errno, os, time, signal | |
import Utils, Scripting, Logs, Build, Node, Options | |
def daemon(ctx): | |
"""rebuild as soon as something changes""" | |
bld = None | |
while True: | |
try: | |
bld = Utils.g_module.build_context() |
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
try: | |
import pyfsevents | |
except ImportError: | |
raise | |
else: | |
class FSEventDirWatch(DirWatch): | |
def __init__(self): | |
pass | |
def wait(self, bld): |
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
# | |
autoload -U compinit | |
autoload -Uz vcs_info | |
autoload -U colors | |
colors | |
compinit | |
setopt auto_pushd | |
setopt correct |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>PayloadContent</key> | |
<array> | |
<dict> | |
<key>FullScreen</key> | |
<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
# -*- coding: utf-8 -*_ | |
from flask import Flask, url_for | |
def test(): | |
# Building test app. | |
app = Flask('test') | |
app.config['SERVER_NAME'] = 'localhost' | |
@app.route('/') |
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 timeit | |
print 'pure sum', timeit.timeit('sum([1] * 10000)', number=100) | |
print 'numpy sum', timeit.timeit('numpy.sum([1] * 10000)', 'import numpy', number=100) | |
print 'pure sum', timeit.timeit('sum(x)', setup='x = [1] * 10000', number=100) | |
print 'numpy sum 1', timeit.timeit('numpy.sum(y)', 'import numpy; y = [1] * 10000', number=100) | |
print 'numpy sum 2', timeit.timeit('numpy.sum(z)', 'import numpy; z = numpy.array([1] * 10000)', number=100) | |
print 'numpy sum 3', timeit.timeit('numpy.sum(numpy.array(y))', 'import numpy; y = [1] * 10000', number=100) |
OlderNewer