Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am connorhudson on github.
  • I am 01 (https://keybase.io/01) on keybase.
  • I have a public key ASDMkeTgshnIIm36h3bT_EpQyWusK14swWkjqZfiscwzPgo

To claim this, I am signing this object:

const https = require('https'),
qs = require('querystring'),
ACCESS_TOKEN = "ACCESS_TOKEN_FROM_SLACK",
VERIFICATION_TOKEN = "TOKEN_FROM_SLACK";
// Verify Url - https://api.slack.com/events/url_verification
function verify(data, callback) {
if (data.token === VERIFICATION_TOKEN) {
callback(null, data.challenge);
}
@hyperobject
hyperobject / tpe-alt.user.js
Created December 2, 2015 18:44
A remixed TPE userscript
// ==UserScript==
// @name thisandagain Summoner
// @namespace thisandagainPlsExplainThisPost
// @version 1.01
// @description Adds a button to posts to magically summon thisandagain
// @author tb10
// @match https://scratch.mit.edu/discuss/*
// @grant none
// ==/UserScript==
@hyperobject
hyperobject / phone.py
Last active October 28, 2015 00:35
Scratch->Phone
import requests
import time
num = 0
user = "technoboy10"
key = "get your own! :P"
message = "event name here"
scratch = 'https://api.scratch.mit.edu/proxy/users/' + user + '/activity/count'
ifttt = 'https://maker.ifttt.com/trigger/' + message + '/with/key/' + key
while True:
@hyperobject
hyperobject / gesture.py
Last active August 29, 2015 14:19
Controlling the cloudBit with the Leap Motion
import Leap # I assume you've already figured out how to use the Leap Motion SDK for this
import partlycloudy as cloud
bit = cloud.Bit('authentication token', 'bit ID') # get these from littleBits cloud control
controller = Leap.Controller() # init Leap Motion
controller.enable_gesture(Leap.Gesture.TYPE_SWIPE) # make sure that the controller will recognize swipes
while True:
frame = controller.frame() # grab a leap motion frame
for gesture in frame.gestures():
if gesture.type is Leap.Gesture.TYPE_SWIPE:
@hyperobject
hyperobject / main.py
Last active August 29, 2015 14:19
Scratch + twitter
"""
pip install python-twitter
pip install requests
pip install bs4
"""
import twitter
import requests
from bs4 import BeautifulSoup as soup
import time
@hyperobject
hyperobject / example.py
Last active November 8, 2015 03:55
Creating music with absolutely anything
import random, music
m = music.MIDI()
notes = [61, 63, 66, 68, 70] #pentatonic scale so it sounds pretty
while True: #Yes, infinite loop. No one cares.
m.send(random.choice(notes), 0.125, 100) #Assuming 120BPM, this sends an eigth note
@hyperobject
hyperobject / keybase.md
Last active August 29, 2015 14:11
keybase.md

Keybase proof

I hereby claim:

  • I am Technoboy10 on github.
  • I am 01 (https://keybase.io/01) on keybase.
  • I have a public key whose fingerprint is 5FDB 08D3 088C FB45 F2FC 16A4 D811 10D1 9D13 9F88

To claim this, I am signing this object:

@hyperobject
hyperobject / s2.py
Last active August 29, 2015 13:56
asldifuqoweiurha;sldjkfh
from __future__ import division
from myro import *
import blockext
from blockext import *
@command("stop both motors")
@hyperobject
hyperobject / __init__.py
Created August 8, 2013 18:27
scratchext module __init__.py
# Copyright (C) 2013 Connor Hudson, Tim Radvan
"""Module for writing Snap! extensions.
See example.py for usage.
Handler functions should return unicode. Non-unicode strings are assumed to
be UTF-8 encoded.
"""