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 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(): |
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
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. |
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 web | |
urls = ( | |
"^/scale$", "Scale", | |
) | |
PAGE = """ | |
<html> | |
<body> |
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 web | |
import jinja2 | |
urls = ( | |
"^/scale$", "Scale", | |
) | |
PAGE2 = """ | |
<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
# simple script | |
from selenium import webdriver | |
caps = {} | |
caps['name'] = 'tony-20140417' | |
caps['build'] = '1.0' | |
caps['browser_api_name'] = 'FF28' | |
caps['screen_resolution'] = '1024x768' |
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 myShader = nil | |
local time | |
function love.load() | |
time = 0 | |
myShader = love.graphics.newShader[[ | |
extern number iGlobalTime; |
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
<html> | |
<head> | |
<script src="jquery-1.11.1.js"></script> | |
<script src="swirly.js"></script> | |
</head> | |
<body> | |
<div id="target"></div> | |
<script> |
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 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() |
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
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 |
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 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() |
OlderNewer