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 array import array | |
import bisect | |
import struct | |
import operator | |
import sys | |
class WordList(object): | |
def __init__(self, words): | |
self.buf = "".join(words) | |
self.offsets = array("L", [0]) |
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
# dns server using dnslib and gevent | |
# based on https://bitbucket.org/paulc/dnslib/src/80d85555aae4/src/server/gevent_server.py | |
# set the key as | |
# set IP:name ip_addr | |
# set TXT:name txtfield | |
# fallback on gevent's dns resolver | |
# gleicon 2011 | |
import gevent |
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
// | |
// Created by Dariusz Rybicki on 17/04/16. | |
// Copyright © 2016 Darrarski. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
/** | |
Returns number of seconds since system became idle | |
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 | |
from sqlalchemy import SQLAlchemy | |
app.config['SQLALCHEMY_DATABASE_URI'] = "mysql+oursql://foo:bar@localhost/test1" | |
# binds multiple database definition | |
app.config['SQLALCHEMY_BINDS'] = { | |
"db1": "mysql+oursql://foo:bar@localhost/test1", |
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
/* | |
* Example how to preload HTML5 video on the iPad (iOS 3.2+) | |
* @author Miller Medeiros | |
* Released under WTFPL | |
*/ | |
var vid = document.createElement('video'); | |
vid.src = 'lol_catz.mp4'; | |
document.getElementById('video-holder').appendChild(vid); |
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
package render | |
import ( | |
"bytes" | |
"fmt" | |
"math" | |
"github.com/pdfcpu/pdfcpu/pkg/api" | |
"github.com/pdfcpu/pdfcpu/pkg/pdfcpu" | |
"github.com/pdfcpu/pdfcpu/pkg/pdfcpu/validate" |
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
requests==2.4.3 | |
rsa==3.1.4 |
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 datetime import datetime, timedelta | |
import functools | |
def timed_cache(**timedelta_kwargs): | |
def _wrapper(f): | |
update_delta = timedelta(**timedelta_kwargs) | |
next_update = datetime.utcnow() + update_delta | |
# Apply @lru_cache to f with no cache size limit |
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 python2 | |
# lrdcq | |
# usage python2 unwxapkg.py filename | |
import sys, os | |
import struct | |
class WxapkgFile(object): | |
nameLen = 0 |
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
# Changed to use content-type flag instead of header: -H 'Content-Type: application/json' | |
siege -c50 -t60S --content-type "application/json" 'http://domain.com/path/to/json.php POST {"ids": ["1","2","3"]}' |
OlderNewer