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 random | |
def collapse_die(dice_count, dice_size): | |
''' | |
Collapse on a 1, rerolling remaining dice. | |
All 1s => 0. | |
''' | |
# Error checking. | |
if dice_count < 1: |
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
it('should always refresh global properties with user traits if present', function() { | |
var id = 'Devon Higgins'; | |
var traits = { trait: 'Pretty Neat', id: id }; | |
analytics.user().userId = id; | |
analytics.user().traits = traits; | |
// Notice no identify() call is made here. | |
// This is to emulate a page reload which loses the global | |
// properties that identify() saves. |
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
# This is module A | |
colton_salary = 900000 | |
def print_hello(): | |
print "hello" | |
class Employee: | |
def __init__(self): | |
self.salary = colton_salary - 5000 |
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
;ghao;yhgd |
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 returnOneOrTwo (self, value): | |
if value is 1: | |
return 1 | |
if value is 2: | |
return 2 | |
print "Oh no! I didn't handle this case!" | |
return 12 # Haha! | |
def badSyntax (self): | |
if self.hungry: |
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 noop (self): | |
if True: | |
pass |
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
#!/usr/bin/gjs | |
imports.searchPath.unshift('lib/jasmine-core'); | |
imports.searchPath.unshift('src'); | |
imports.searchPath.unshift('src/core'); | |
imports.searchPath.unshift('src/core/matchers') | |
imports.searchPath.unshift('src/consoleJ'); | |
imports.searchPath.unshift('.'); | |
/* |