Skip to content

Instantly share code, notes, and snippets.

View powersjcb's full-sized avatar

Jacob Powers powersjcb

View GitHub Profile
@powersjcb
powersjcb / gist:d48651da054c34d0c1d615011af2906c
Created August 10, 2018 19:44
aws mqtt setup with python
# Ref: https://github.com/eclipse/paho.mqtt.python#getting-started
from paho.mqtt.client import ssl
import paho.mqtt.client as mqtt
client = mqtt.Client()
def on_message(*args):
print(args)
def on_connect(*args):

Keybase proof

I hereby claim:

  • I am powersjcb on github.
  • I am powersjcb (https://keybase.io/powersjcb) on keybase.
  • I have a public key whose fingerprint is 6DBC 3C75 6FC1 DB92 24B6 3319 004D E36A BCD3 2E39

To claim this, I am signing this object:

import json
from pprint import pprint
from datetime import datetime
def load_json_data(path):
start_time = datetime.now()
f = open(path, 'r')
# stripping out data contaminants from Crunchbase
first_line = f.readline()
# 1. Create a Hash with keys of directions that have been checked for a match
class Piece
@checked_directions = {:horizontal => false, :vertical => false, :left_diag => false, :right_diag => false}
end
# 2. Iterate through each element (as was previously implemented)
# DUP All the pieces for this next step O(n^2) where n is the width of the grid.
dup_pieces = pieces.map {|el| el.dup}
pieces.any? { |piece| piece.winning? }