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
# conftest.py | |
import datetime | |
from time import strptime | |
from dateutil import parser | |
from sqlalchemy import create_engine | |
def is_test(): | |
""" |
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 time | |
from random import randint | |
def demo(): | |
foo = randint(0, 100) | |
print(f"int is {foo}") | |
return foo % 5 == 0 | |
def _wait_for(condition_func, interval=0.5, max_time=15): |
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
1.Miracle Whip | |
2.Pickles | |
3.Cilantro | |
4.Black Jelly Beans | |
5.Pineapple Pizza | |
6.Sardines | |
6.Oysters | |
8.Sushi | |
9. Candy Corn | |
10. Vienna Sausages |
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 following data should be run in the console while viewing the page https://read.amazon.com/ | |
// It will export a CSV file called "download" which can (and should) be renamed with a .csv extension | |
var db = openDatabase('K4W', '3', 'thedatabase', 1024 * 1024); | |
getAmazonCsv = function() { | |
// Set header for CSV export line - change this if you change the fields used | |
var csvData = "ASIN,Title,Authors,PurchaseDate\n"; | |
db.transaction(function(tx) { |
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- we use auth0, some of this is specific to that | |
steps: | |
launch and look at the UI to make sure everthing is working | |
npm update all gently (i.e "npm update" without hand-editing package.json) | |
dependencies: (these will need the ^ later but for now leave it as is until it's proven to work) | |
- "react-router": "4.4.0-beta.8", | |
- react-router-redux -> "react-router-dom": "4.4.0-beta.8", | |
- "redux-auth-wrapper": "^2.1.0", | |
(note: add the ^ after changes are done so upgrades will kick in- there are more versions already!!) |
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 handleAuthenticated (dispatch) { | |
lock.on('authenticated', ({ accessToken, idToken, state }) => { | |
lock.getUserInfo(accessToken, (error, user) => { | |
if (error) { | |
return dispatch(lockError(error)) | |
} | |
setUser(user) | |
setToken(idToken) |
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 {List, Map} from 'immutable' | |
test('test name goes here', () => { | |
const currentFlags = List([ | |
Map({id: 7, tag: 'flag/bbb:JAR'}), | |
Map({id: 6, tag: 'flag/bbb'}), | |
Map({id: 9, tag: 'flag/ccc:ADV'}), | |
Map({id: 8, tag: 'flag/bbb:ELI'}), | |
Map({id: 10, tag: 'flag/ccc:JAR'}) | |
]) |
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
# for use with sqlalchemy | |
def test_foo(): | |
stmts = [] | |
def catch_queries(conn, cursor, statement, a, b, c): | |
stmts.append(statement) | |
event.listen(engine, "before_cursor_execute", catch_queries) | |
do_thing() | |
assert _most_frequent_queries(queries=stmts, query_count=4, query_type='SELECT', query_print_length=50) == [('SELECT X FROM Y', 5)] |
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
Apple Health | |
AgileMD | |
Alpha Health | |
Alto Pharmacy | |
Amino Healthcare | |
Augmedix | |
Benchling | |
Carbon Health | |
Clover Health | |
Cricket Health |
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
def pick_tie_jurors(potential_jurors, k) | |
potential_jurors.combination(k).map do |combo| # 2 3 | |
p_tie = combo.combination(combo.count / 2).map { |possibles| # [2] # [3] | |
# inverses = [2, 3] - [2] # bug with distinct # [3] | |
inverses = (combo - possibles).map { |i| 1 - i } # bug with distinct # [3] | |
acc = 0 | |
possibles.map { |pos| | |
inverses.map { |inv| | |
pos * inv |