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 peewee import * | |
#import pymysql | |
import peewee | |
# 'id' to 'BIGINT AUTO_INCREMENT' | |
peewee.MySQLDatabase.field_overrides['primary_key'] = 'BIGINT AUTO_INCREMENT' | |
db = peewee.MySQLDatabase( | |
database='peewee_development', | |
user='root', | |
password='', |
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 torndb | |
mysql_settings = { | |
'host': 'localhost:3306', | |
'user': 'user', | |
'password': 'password', | |
'database': 'database', | |
'time_zone': '-8:00', | |
'charset': 'utf8' |
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 xlwt | |
import random | |
import numpy | |
import json | |
import statistics | |
ezxf = xlwt.easyxf | |
sampleCount = 10 | |
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 android,time | |
droid = android.Android() | |
def getPos(waitTime=15): | |
droid.startLocating() | |
time.sleep(waitTime) | |
loc = droid.readLocation().result | |
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
# Note, the local keyword is not strictly posix compliant but supported in | |
# most shells. You can remove them w/o affecting the scripts except those | |
# variables will still be in scope outside the function, which can cause some | |
# info leakage unless you clear them (and you'd want to also trap so they'd be | |
# cleared when the script is interrupted with something like ctl-c etc) | |
prox="http://proxy.check:8080" | |
alias proxyon="export http_proxy=$prox && export https_proxy=$prox" | |
alias proxyoff='unset http_proxy && unset https_proxy' |
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
CREATE TABLE `data` ( | |
`name` varchar(255) DEFAULT NULL, | |
`value` blob | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
insert into crypt_test.data values("hello.world", AES_ENCRYPT("test", SHA2("ld", 512))); | |
select CONVERT(AES_DECRYPT(value, SHA2("ld", 512)) using UTF8) as d FROM crypt_test.data |
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
class Backend(object): | |
"""Allows access to backend and removes logic from handlers""" | |
def __init__(self): | |
"""Inititalize with the variables you need""" | |
self.__users_data = None | |
self.db = Connection( | |
options.db_host, | |
options.db, | |
user=options.db_user, |
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
var screenshotUrl = 'http://example.com/' | |
var casper = require("casper").create({ | |
viewportSize: { | |
width: 1280, | |
height: 1280 | |
} | |
}); | |
if (casper.cli.args.length < 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project name="name-of-project" default="build"> | |
<target name="build" depends="prepare,lint,phploc,pdepend,phpcb,phpmd-ci,phpcs-ci,phpcpd,phpunit"/> | |
<target name="build-parallel" depends="prepare,lint,tools-parallel,phpunit"/> | |
<target name="tools-parallel" description="Run tools in parallel"> | |
<parallel threadCount="3"> | |
<sequential> | |
<antcall target="pdepend"/> |
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 json | |
import bottle | |
@bottle.get("/text") | |
def text(): | |
return "Returning text" | |
@bottle.get("/data/get") | |
def get_data(): |
NewerOlder