Moved to github.com/marklit/recommend
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| { | |
| "ACE-BFS": { | |
| "airports": { | |
| "ACE": { | |
| "airport_name": "Lanzarote Airport", | |
| "iata": "ACE", | |
| "latitude": 28.94556, | |
| "longitude": -13.60528 | |
| }, | |
| "BFS": { |
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 hashlib | |
| import uuid | |
| int(hashlib.sha1(str(uuid.uuid4()).replace('-', '')).hexdigest(), 16) % 2147483647 |
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
| pip install requests termcolor tabulate |
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
| pip install sh |
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 random import randint | |
| LIVING_SPACE_CELL_SIZE = 24 | |
| class Alive(object): | |
| pass | |
$ echo manual | sudo tee /etc/init/logstash-web.override
$ sudo stop logstash-web
$ sudo stop logstash
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 postcode import uk as uk_postcode | |
| """ | |
| 452012,S119FJ,53.357507510309200,-1.505868797298880 | |
| 452013,S119FL,53.357735137233300,-1.506572342021560 | |
| 452014,S119FN,53.356698394080900,-1.503669525537920 | |
| """ | |
| for line in open('postcodes.csv'): | |
| pieces = line.strip().split(',') |
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 itertools import chain, product | |
| from re import match, findall | |
| GRAMMAR = ''' | |
| <sentence> ::= <noun phrase=""> <verb phrase=""> | |
| <noun> ::= "boy " | "troll " | "moon " | "telescope " | |
| <transitive verb=""> ::= "hits " | "sees " | |
| <intransitive verb=""> ::= "runs " | "sleeps " | |
| <adjective> ::= "big " | "red " |