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
Microwaving for 4 sec facing [0, 0, 1] | |
Microwaving for 4 sec facing [0, 0, -1] | |
Microwaving for 4 sec facing [0, 1, 0] | |
Microwaving for 4 sec facing [0, -1, 0] | |
*** DING! *** |
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
from pyquaternion import Quaternion | |
import math | |
rot180 = Quaternion(axis=[1, 0, 0], angle=math.pi) | |
rot90 = Quaternion(axis=[1, 0, 0], angle=math.pi / 2.0) | |
def microwave(up): | |
print('Microwaving for 4 sec facing [%d, %d, %d]' % tuple(up)) | |
def soften_butter(): |
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
> cd folder-a | |
folder-a> do something in folder-a | |
folder-a> cd ..\folder-b | |
folder-b> do something in folder-b | |
folder-b> cd ..\folder-c | |
folder-c> do something in folder-c | |
folder-c> cd .. | |
> echo "Home sweet home" |
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
r'# Person \d+.*?(?=# Person \d+|$)' |
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
r'# Person \d+.*?(?=# Person \d+)' |
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
r'# Person \d+.*?' |
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
import re | |
import pprint | |
def header_split(text, header_pattern): | |
""" Return chunks of text split by the header pattern. | |
Keyword arguments: | |
text -- Text that is desired to be split. | |
header_pattern -- Regular expression pattern string that sufficiently | |
describes the header of each chunk. |
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
# Person 1 | |
Name: Frodo | |
DOB: 9/22/2968 | |
Favorite Food: Mushroom Pizza | |
# Person 2 | |
Name: Samwise | |
DOB: 4/6/2980 | |
Favorite Food: Lembas with Queso | |
# Person 3 | |
Name: Gollum |
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 submit_lookup() { | |
var lookup_obj = $("#lookup"); | |
var search_term = lookup_obj.val(); | |
lookup(search_term); | |
if (!isMobile.any) | |
lookup_obj.focus(); | |
} |
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
var results_template = null; | |
function render_results(search_term, results) { | |
var num_results = Object.keys(results).length; | |
var html = results_template({ | |
"search_term": search_term, | |
"num_results": num_results, | |
"has_results": num_results > 0, | |
"results": results | |
}); |
NewerOlder