Skip to content

Instantly share code, notes, and snippets.

View audiodude's full-sized avatar

Travis Briggs audiodude

View GitHub Profile
#include <iostream>
// GLEW
// #define GLEW_STATIC
// #include <GL/glew.h>
// GLFW
#include <GLFW/glfw3.h>

This script finds all of the Pinboard posts with 'reading' as a tag and removes that tag, instead marking the item as "unread".

The script requires Requests:

pip install requests

It also requires a previous download of https://api.pinboard.in/v1/posts/all?format=json, saved as posts.json in the same directory as the script.

File Edit Options Buffers Tools Python Help
#!/usr/bin/python3
"""
"You can't spell 'skateboarding' without d-a-t-a-g-r-o-k."
Usage: python3 cantspell.py WORD
Prints all the words in its dictionary that contain at least all the
letters given in WORD
"""
from collections import Counter
@audiodude
audiodude / mytwitterbot.conf
Created November 3, 2015 19:09
Supervisor (http://supervisord.org/) config script for a twitter bot written in pybot: https://github.com/magsol/pybot. Put in /etc/supervisor/conf.d/
[program:mytwitterbot]
command=/home/homeuser/.pyenv/versions/mytwitterbot/bin/python mytwitterbot.py
directory=/home/homeuser/mytwitterbot
user=homeuser
autostart=true
autorestart=true
@audiodude
audiodude / test.html
Last active April 2, 2016 03:27
First attempt at generating HTML using torch-rnn (based on char-rnn)
<!DOCTYPE html>
<html lang="ener">
<meta>
<meta>
<meta>
<meta>
<meta>
<meta>
<meta>
</head>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@audiodude
audiodude / stack_trace.txt
Last active August 31, 2016 19:25
Stack trace running Magenta on approximately 2700 MIDI files
W tensorflow/core/common_runtime/bfc_allocator.cc:270] *****************************************************************************xxxxxxxxxxxxxxxxxxxxxxx
W tensorflow/core/common_runtime/bfc_allocator.cc:271] Ran out of memory trying to allocate 52.51MiB. See logs for memory state.
W tensorflow/core/framework/op_kernel.cc:936] Resource exhausted: OOM when allocating tensor with shape[2830,128,38]
E tensorflow/core/client/tensor_c_api.cc:485] OOM when allocating tensor with shape[2830,128,38]
[[Node: transpose = Transpose[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/gpu:0"](padding_fifo_queue_DequeueMany/_60, transpose/perm)]]
[[Node: mul/_68 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/gpu:0", send_device_incarnation=1, tensor_name="edge_208_mul", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]()]]
INFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python.fra
$ python wand_test.py
Traceback (most recent call last):
File "wand_test.py", line 25, in <module>
image.save(file=out_file)
File "/Users/tmoney/.pyenv/versions/3.5.1/lib/python3.5/site-packages/wand/image.py", line 3062, in save
file.write(self.make_blob())
File "/Users/tmoney/.pyenv/versions/3.5.1/lib/python3.5/site-packages/wand/image.py", line 3111, in make_blob
self.raise_exception()
File "/Users/tmoney/.pyenv/versions/3.5.1/lib/python3.5/site-packages/wand/resource.py", line 222, in raise_exception
raise e
@audiodude
audiodude / keybase.md
Created October 9, 2016 19:11
Proving myself on Github

Keybase proof

I hereby claim:

  • I am audiodude on github.
  • I am audiodude (https://keybase.io/audiodude) on keybase.
  • I have a public key whose fingerprint is 57A7 57AF F622 0A34 4F3E 32F9 7226 1D72 7844 947A

To claim this, I am signing this object:

@audiodude
audiodude / quirky.py
Created November 7, 2016 04:51
Random sentence mangler
import nltk
import random
STOP_WORDS = ['the', 'a', 'and', 'of', 'in', 'with', 'for', 'on']
def rhyme(inp, level):
entries = nltk.corpus.cmudict.entries()
syllables = [(word, syl) for word, syl in entries if word == inp]
rhymes = []
for (word, syllable) in syllables: