Skip to content

Instantly share code, notes, and snippets.

View tonetheman's full-sized avatar

Tony Colston tonetheman

View GitHub Profile
from passlib.context import CryptContext
pwd_context = CryptContext(
schemes = ["sha512_crypt"],
default = "sha512_crypt",
all__vary_rounds = 0.1,
pbkdf2_sha256__default_rounds = 8000,
)
def make_some_hash():
The Challenge
-------------
Given the following riddle, write a regular expression describing all possible answers,
assuming you never make a move which simply undoes the last one you made.
The Riddle
----------
You are on your way somewhere, taking with you your cabbage, goat, and wolf, as always.
You come upon a river and are compelled to cross it, but you can only carry one of the
three animals at a time. None of whom can swim because this isn't THAT kind of riddle.
@tonetheman
tonetheman / web-templates.py
Created March 4, 2014 17:32
simple template with web.py
import web
urls = (
"^/scale$", "Scale",
)
PAGE = """
<html>
<body>
@tonetheman
tonetheman / web-templates-jinja.py
Created March 4, 2014 18:46
web templates with jinja2 looks more like what i would expect
import web
import jinja2
urls = (
"^/scale$", "Scale",
)
PAGE2 = """
<html>
# simple script
from selenium import webdriver
caps = {}
caps['name'] = 'tony-20140417'
caps['build'] = '1.0'
caps['browser_api_name'] = 'FF28'
caps['screen_resolution'] = '1024x768'
@tonetheman
tonetheman / lua_love_fireworks.lua
Created July 4, 2014 03:23
lua/love shader fireworks
local myShader = nil
local time
function love.load()
time = 0
myShader = love.graphics.newShader[[
extern number iGlobalTime;
@tonetheman
tonetheman / swirly_index.html
Created July 14, 2014 03:29
swirly testing!
<html>
<head>
<script src="jquery-1.11.1.js"></script>
<script src="swirly.js"></script>
</head>
<body>
<div id="target"></div>
<script>
@tonetheman
tonetheman / sel-example1.py
Created July 18, 2014 13:16
selenium-example-1 to show how to use driver find element and python
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.send_keys("selenium")
elem.send_keys(Keys.RETURN)
driver.close()
@tonetheman
tonetheman / array2d.lua
Created August 2, 2014 12:07
2 ways to make a 2d array with lua
function mk_array1()
-- standard way here
local mt = {}
for i=0,10 do
mt[i] = {}
for j=0,10 do
mt[i][j] = 0
end
end
return mt
@tonetheman
tonetheman / chrome_driver_Example.py
Created September 11, 2014 16:27
chrome driver example getting rid of ugly yellow bar at the top!
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
opts = Options()
opts.add_argument("--test-type")
CHROME_DRIVER_PATH="c:\\projects\\2014\\sep\\chromedriver\\chromedriver.exe"
driver = webdriver.Chrome(executable_path=CHROME_DRIVER_PATH,chrome_options=opts)
driver.get("http://yahoo.com")
driver.quit()