Created
March 30, 2016 14:48
-
-
Save mfellner/bf01a5e7551d56e3868f3b2b08d2b9c7 to your computer and use it in GitHub Desktop.
Example of formatting code (JavaScript is slightly unidiomatic)
This file contains hidden or 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 fn_foo(data_one, data_two): | |
for element_x in select_element(data_one, lambda key, value, parent: key == | |
'type' and value == 'example' and 'flip' in parent and 'flop' in parent): | |
for element_y in select_element(data_two, lambda key, value, parent: key == | |
'flip' and value == element_y['flip']): | |
element_x['flop'] = element_y['flop'] |
This file contains hidden or 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 fn_foo(data_one, data_two) { | |
for (let element_x of select_element(data_one, (key, value, parent) => | |
key === 'type' && value === 'example' && 'flip' in parent && 'flop' in parent | |
)) { | |
for (let element_y of select_element(data_two, (key, value, parent) => | |
key === 'flip' && value === element_y.flip | |
)) { | |
element_x['flop'] = element_y['flop'] | |
} | |
} | |
} |
This file contains hidden or 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 fn_foo(data_one, data_two) { | |
for (let element_x of select_element(data_one, (key, value, parent) => | |
key === 'type' && | |
value === 'example' && | |
'flip' in parent && | |
'flop' in parent | |
)) { | |
for (let element_y of select_element(data_two, (key, value, parent) => | |
key === 'flip' && | |
value === element_y.flip | |
)) { | |
element_x['flop'] = element_y['flop'] | |
} | |
} | |
} |
This file contains hidden or 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 fn_foo(data_one, data_two): | |
for element_x in select_element(data_one, lambda key, value, parent: key == 'type' and value == 'example' and 'flip' in parent and 'flop' in parent): | |
for element_y in select_element(data_two, lambda key, value, parent: key == 'flip' and value == element_y['flip']): | |
element_x['flop'] = element_y['flop'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment