Skip to content

Instantly share code, notes, and snippets.

View singlerider's full-sized avatar
🏝️

Shane Engelman singlerider

🏝️
  • San Francisco, CA
View GitHub Profile
@singlerider
singlerider / glass.html
Created March 23, 2014 21:58
[wearscript] Test Gist
<html style="width:100%; height:100%; overflow:hidden">
<head>
<!-- You can include external scripts here like so... -->
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>-->
</head>
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<canvas id="canvas" width="640" height="360" style="display:block"></canvas>
<script>
function server() {
"""
Developed Shane Engelman <me@5h4n3.com>
"""
# IN ORDER FOR THIS TO RUN CORRECTLY
# run '!shots init 0' the first time
import globals
import pickle
from src.lib.twitch import *
import time
from threading import Thread
def initialize(irc, config):
# start up the cron jobs.
# config should be in the structure of
# {
# "#channel": [ (period, enabled, callback),.... ]
# ...
# }
import requests
import json
def urban(args):
word = args[0].replace(' ','%20')
word_url = 'http://api.urbandictionary.com/v0/define?term=' + word
word_resp = requests.get(url=word_url)
translated_word = json.loads(word_resp.content)
found_word = translated_word['list'][0]['word']
definition = translated_word['list'][0]['definition']
@singlerider
singlerider / github_report_issue.py
Last active January 30, 2016 05:35
Submit A Github Issue using API V3 and Python's requests lib
import json
import requests # pip install requests
def report(args):
username = "github username"
bot_repo = "bot repository name (on username's account)"
github_token = "github token obtained from https://github.com/settings/tokens with scopes"
reporter = "user reporting issue"
@singlerider
singlerider / twitch_tmi_connect.py
Last active February 8, 2016 00:46
Connect to Twitch Chat and Whispers simultaneously (IRC connection)
server = 'irc.twitch.tv'
port = 6667
username = 'lorenzotherobot'
oauth_password = 'oauth:5fakeOuathud90jsdam' # get this from http://twitchapps.com/tmi/
channel = "#singlerider"
from twisted.internet import reactor
from twisted.words.protocols import irc
from twisted.internet.protocol import ClientFactory
import time

Keybase proof

I hereby claim:

  • I am singlerider on github.
  • I am singlerider (https://keybase.io/singlerider) on keybase.
  • I have a public key ASAWM1LE7BMLrdh73f4kW6c8Yp6uwjC5bXWdPXKqNK6nUgo

To claim this, I am signing this object:

@singlerider
singlerider / gdax_time_series.py
Last active June 16, 2017 05:02
GDAX Time Series Data for datetime.now() ~24 hours
import json
import time
import urllib
import urllib2
from datetime import datetime, timedelta
URL = "https://api.gdax.com"
def candles(product):
websockets==4.0.1

Keybase proof

I hereby claim:

  • I am singlerider on github.
  • I am singlerider (https://keybase.io/singlerider) on keybase.
  • I have a public key ASDGFHR3Lwy18My2EgWpLJ7NbhjhSAYfM_DC1GZ1RoAy2go

To claim this, I am signing this object: