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
class InfiniteLineup: | |
def __init__(self, players): | |
self.players = players | |
def lineup(self): | |
lineup_max = len(self.players) | |
idx = 0 | |
while True: | |
if idx < lineup_max: |
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
class Lineup: | |
def __init__(self, players): | |
self.players = players | |
def __iter__(self): | |
self.n = 0 | |
return self | |
def __next__(self): |
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
class Invoice: | |
def __init__(self, client, total): | |
self.client = client | |
self.total = total | |
def __str__(self): | |
return f"Invoice from {self.client} for {self.total}" | |
def __repr__(self): | |
return f"Invoice({self.client}, {self.total})" |
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
class Invoice: | |
def __str__(self): | |
return "This is the invoice class!" | |
inv = Invoice() | |
print(str(inv)) | |
class Invoice: | |
def __init__(self, client, total): |
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
# [0, 1, 2, 3, 4] | |
# [1, 2, 3, 4, 5] | |
# [2, 3, 4, 5, 6] | |
# [3, 4, 5, 6, 7] | |
# [4, 5, 6, 7, 8] | |
def manual_incrementing_matrix(n): | |
matrix = [ [ None for y in range( n ) ] for x in range( n ) ] | |
""" |
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
class Invoice: | |
def __init__(self, client, total): | |
self.client = client | |
self.total = total | |
def formatter(self): | |
return f'{self.client} owes: ${self.total}' | |
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
heroku buildpacks:clear | |
heroku buildpacks:set heroku/nodejs | |
heroku buildpacks:add heroku/ruby --index 2 |
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
ready = -> | |
$('#toggle-btn').click -> | |
$('.container').fadeOut() | |
return | |
$(document).ready ready | |
$(document).on 'turbolinks:load', ready |
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
<div class="container"> | |
Maecenas sed diam eget risus varius blandit sit amet non magna. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sed odio dui. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Vestibulum id ligula porta felis euismod semper. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula ut id elit. | |
</div> | |
<button id="toggle-btn">Hide Content</button> |
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
//= require jquery | |
//= require jquery_ujs | |
//= require turbolinks | |
//= require_tree . |