Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am provolot on github.
  • I am dantaeyoung (https://keybase.io/dantaeyoung) on keybase.
  • I have a public key whose fingerprint is C562 2B11 BABC EB93 5615 362E C2C5 133A 582C 38DD

To claim this, I am signing this object:

@dantaeyoung
dantaeyoung / gist:14424d254d86ff16ea48
Last active August 29, 2015 14:07
HTML DOM listener
(function() {
// Load jQuery
var script = document.createElement("SCRIPT");
script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';
script.type = 'text/javascript';
document.getElementsByTagName("head")[0].appendChild(script);
// Poll for jQuery to come into existance
var checkReady = function(callback) {
if (window.jQuery) {
@dantaeyoung
dantaeyoung / gifify_instagram_user.sh
Last active December 26, 2015 10:30
Create GIF of Instagram User
############## TOTALLY HACKY
############## REQUIRES https://github.com/akurtovic/InstaRaider
############## EDIT $USERNAME AND RUN IT IN PARENT DIRECTORY OF InstaRaider REPO
############## example: ./gifify_instagram_user.sh
#!/bin/bash
USERNAME="alanpaukman"
#milliseconds
GIFDELAY=15
### @dantaeyoung/provolot
### homage to http://techcrunch.com/2009/04/21/4chan-takes-over-the-time-100/
### for @leoneckert's https://github.com/leoneckert/trending_imessage_research
import random
from collections import defaultdict
random_words = ["Abyssinian", "Adelie Penguin", "Affenpinscher", "Afghan Hound", "African Bush Elephant", "African Civet", "African Clawed Frog", "African Forest Elephant", "African Palm Civet", "African Penguin", "African Tree Toad", "African Wild Dog", "Ainu Dog", "Airedale Terrier", "Akbash", "Akita", "Alaskan Malamute", "Albatross", "Aldabra Giant Tortoise", "Alligator", "Alpine Dachsbracke", "American Bulldog", "American Cocker Spaniel", "American Coonhound", "American Eskimo Dog", "American Foxhound", "American Pit Bull Terrier", "American Staffordshire Terrier", "American Water Spaniel", "Anatolian Shepherd Dog", "Angelfish", "Ant", "Anteater", "Antelope", "Appenzeller Dog", "Arctic Fox", "Arctic Hare", "Arctic Wolf", "Armadillo", "Asian Elephant", "Asian Giant Hornet",

Keybase proof

I hereby claim:

  • I am dantaeyoung on github.
  • I am dantaeyoung (https://keybase.io/dantaeyoung) on keybase.
  • I have a public key whose fingerprint is C562 2B11 BABC EB93 5615 362E C2C5 133A 582C 38DD

To claim this, I am signing this object:

@dantaeyoung
dantaeyoung / studio_layout.py
Last active July 6, 2018 06:38
process to generate all possible studio combinations and to rank them by trying to make the lowest ranking the highest
import random, sys, itertools, math, statistics
PEOPLES_CHOICES = [
['K','D','C','N','A','E','H','I','L','M'],
['I','H','J','E','C','F','D','N','K','A'],
['N','M','D','L','A','K','J','D','G','I'],
['D','N','K','L','M','J','G','I','H','F'],
['D','K','N','F','B','G','J','E','C','I'],
['D','N','K','I','H','A','E','C','F','M']
@dantaeyoung
dantaeyoung / studio_layout_weighted.py
Created July 6, 2018 07:00
weights studios based on how many people are in them
import random, sys, itertools, math, statistics
PEOPLES_CHOICES = [
['K','D','C','N','A','E','H','I','L','M'] ,
['I','H','J','E','C','F','D','N','K','A'] ,
['N','M','D','L','A','K','J','D','G','I'] ,
['D','N','K','L','M','J','G','I','H','F'],
['D','K','N','F','B','G','J','E','C','I'] ,
['D','N','K','I','H','A','E','C','F','M']
@dantaeyoung
dantaeyoung / studio_layout_weighted_solidarity.py
Created July 10, 2018 19:12
studio layout for solidarity!
import random, sys, itertools, math, statistics
PEOPLES_CHOICES = [
['K','D','C','N','A','E','H','I','L','M'] ,
['I','H','J','E','C','F','D','N','K','A'] ,
['N','M','D','L','A','K','J','D','G','I'] ,
['D','N','K','L','M','J','G','I','H','F'],
['D','K','N','F','B','G','J','E','C','I'] ,
['D','N','K','I','H','A','E','C','F','M']
@dantaeyoung
dantaeyoung / 190523_ntoo_better_serial_thread
Created May 23, 2019 20:26
ntoo serial thread that detects errors and reconnects without crashing the whole program - belongs in `chatbot/inference_sensors.py`
def serial_thread():
ser = None
while True:
try:
# TRIES TO CONNECT
if(ser == None):
ser = serial.Serial(usbport)
ser.flushInput()
logger.log("[SERIAL] (Re)connecting serial thread...")
except: