Skip to content

Instantly share code, notes, and snippets.

View deloschang's full-sized avatar

Delos Chang deloschang

View GitHub Profile
(Pdb) master_cb
{'solar.Quote': [{'fx': 'solve', 'priority': 1}], 'system.System': [], 'system.Array': [{'fx': 'map_generation', 'priority': 10}]}
Extract callback and sort
res = [(k, x) for k,v in master_cb.items() for x in v]
res.sort(key=lambda x: x[1]['priority'], reverse=True)
(Pdb) res
[('system.Array', {'fx': 'map_generation', 'priority': 10}), ('solar.Quote', {'fx': 'solve', 'priority': 1})]
# GLOBAL CONFIGURATIONS
# -------------------------------------------------------------------
# See https://github.com/jigish/slate/wiki/Global-Configs
config defaultToCurrentScreen true
config secondsBeforeRepeat 0.4
config secondsBetweenRepeat 0.1
config keyboardLayout "qwerty"
config nudgePercentOf screenSize
config resizePercentOf screenSize
with open('http.txt') as f:
first_line = f.readline()
split_lines = first_line.split('http://')
with open('output.txt') as g:
for x in split_lines:
to_output = 'http://' + x + '\n'
g.write(to_output)