ctrl+x, ctrl+f Open file
ctrl+x, ctrl+s Save
ctrl+x, ctrl+w Save As
ctrl+x, s Save All
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 sys | |
class Node(object): | |
def __repr__(self): | |
return 'Node(value=%s)' % self.value | |
def __init__(self, value): | |
self.value = value | |
self.neighbors = set() |
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
2014-10-05 11:40:18,301 - WebSocketHandler - INFO - [On Message]: {"id":42,"command":"query_page","params":{"type":"query_page","findGUID":"26112cd97a623df8cb4f852911172583b06489c6"}} | |
2014-10-05 11:40:18,301 - [1] ProtocolHandler - INFO - (I) ws.ProtocolHandler.handle_request of: query_page | |
2014-10-05 11:40:18,301 - [1] ProtocolHandler - DEBUG - found a handler! | |
2014-10-05 11:40:18,301 - [1] Market - INFO - Searching network for node: 26112cd97a623df8cb4f852911172583b06489c6 | |
2014-10-05 11:40:18,301 - [1] CryptoTransportLayer - DEBUG - Outgoing Data: {'findGUID': u'26112cd97a623df8cb4f852911172583b06489c6', 'type': 'query_page', 'uri': 'tcp://69.142.134.112:12345', 'senderGUID': u'1e42b94d3f3183e9989975280ce9a6d753bdce2c', 'pubkey': u'04470cc0fb7764d2e8b31edc0ac1018d775c0bf5a799811058050d1e6c51f3f144a2d7e0409e89daca046256aa661704b3c66eacb893f31545a83b31e9b4747467', 'sin': u'9xHVXEzK2JrAnRvDuD4PnPJqAnXYi1UghhVSr9'} 26112cd97a623df8cb4f852911172583b06489c6 | |
2014-10-05 11:40:18,301 - [1] KBucket - DEBUG - [getCo |
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 SeenQueue(object): | |
def __init__(self): | |
self.seen = [None, None] | |
def is_double(self): | |
if (self.seen[0] == None and self.seen[1] == None): | |
return False | |
if self.seen[0] == self.seen[1]: | |
return True |
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
// Quick sketch of what some common ADT implementations might look like in Golang. | |
// I'm thinking about maybe building some sort of very basic program off them. | |
// Like a stack-based Polish notation calculator (or something)> | |
type Entity struct { | |
Content interface{} // generic? | |
} | |
type Stack struct { | |
Values []Entity |
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 requests | |
import time | |
# Tinder beefed up their API security, so it's no longer possible to grab the facebook OAuth | |
# token and use it to dynamically retreive this value. You'll have to manually inspect the returned | |
# call using Charles or some other reverse https proxy for now. | |
access_token = "SOME_SESSION_KEY" | |
# some very simple backoff logic | |
backoff = [1,2,4,8,16,0] |
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 random | |
#Face Cards | |
ACE = 'Ace' | |
JACK = 'Jack' | |
KING = 'King' | |
QUEEN = 'Queen' | |
#Suits | |
CLUBS = 'Clubs' |
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
BASE_16 = 16 | |
HEXADECIMAL_CHARACTERS = [ | |
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, | |
'A', 'B', 'C', 'D', 'E', 'F', | |
] | |
DECIMAL_TO_HEXADECIMAL_MAPPING = { | |
x: HEXADECIMAL_CHARACTERS[x] | |
for x in range(len(HEXADECIMAL_CHARACTERS)) | |
} |
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
{% extends "base.html" %} | |
{% block content %} | |
<h2>Dry Cleaning Orders</h2> | |
{% url 'dry_cleaning_add' as add_dry_cleaning_url %} | |
<div class="btn-toolbar"> | |
<a href="{{ add_dry_cleaning_url }}"> | |
<button class="btn btn-primary">New Order</button> | |
</a> | |
</div> |
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 md5 | |
import requests | |
from requests.auth import HTTPBasicAuth | |
class DigestClient(object): | |
def __init__(self, url, username, password): | |
self.url = url | |
self.username = username |