Skip to content

Instantly share code, notes, and snippets.

View jefftriplett's full-sized avatar
Living the dream

Jeff Triplett jefftriplett

Living the dream
View GitHub Profile
@kylemcdonald
kylemcdonald / CameraImage.cpp
Created November 23, 2015 15:30
openFrameworks app for sending images to disk for processing, and reading text back from disk. Used for "NeuralTalk and Walk".
#include "ofMain.h"
#include "ofxTiming.h"
class ofApp : public ofBaseApp {
public:
ofVideoGrabber grabber;
DelayTimer delay;
ofTrueTypeFont font;
string description;
@maurisvh
maurisvh / spectrogram.py
Last active January 27, 2025 18:47
ANSI art spectrogram viewer that reads audio from a microphone
#!/usr/bin/python
import numpy
import pyaudio
import re
import sys
WIDTH = 79
BOOST = 1.0
@iminurnamez
iminurnamez / state_engine.py
Last active June 12, 2024 15:49
Simple state engine example
#This code is licensed as CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/legalcode).
import sys
import pygame as pg
class Game(object):
"""
A single instance of this class is responsible for
managing which individual game state is active

aws-cli bash helper functions

The official AWS command line tools, have support for configuration profiles. See Configuring the AWS Command Line Interface - Named Profiles.

Managing multiple profiles with the AWS CLI itself is relatively straight forward, switching between them with --profile flag on the command line or the AWS_PROFILE environment variable.

These helpers extend that functionality for convenience with other tools in the ecosystem.

aws-profile

@gabrielfalcao
gabrielfalcao / README.md
Last active October 17, 2015 14:31
boot2docker-compatible, self-contained example of using docker-py to pull a redis python image, build a dockerfile with a python script in it, run that python script linked to the redis container and see the magic !

docker-py + pure python tarball generation

If you are in a linux box running docker or a MacOS running boot2docker, and have 5 minutes to spare, just install docker-py:

pip install docker-py

And run the script above.

@manvijain06
manvijain06 / rts.py
Created May 26, 2015 09:41
This Python script is a basic RTS game, with a modified version of Lanchester's Square Law to calculate eventual attrition rates, as well as force sizes, for two opposing forces. It is adapted from a sample IronPython module, and works on CPython, Jython and other Python toolchains as well.
print 'RTS Simulator.'
# Import random numbers.
try:
# this should be the normal path if Python has access to the standard library.
import random
except:
# This is a fallback for IronPython when running wihtout access to the standard library
import _random as random
@scripting
scripting / wp.js
Created May 9, 2015 15:29
I wrote this app to convert an entire WordPress site to OPML. I thought it might go somewhere, but it didn't. Maybe the code will be of use to someone else someday, so here it is.
var myVersion = "0.43";
//last build 4/17/2014; 1:03:26 PM
var http = require ("http");
var AWS = require ("aws-sdk");
var s3 = new AWS.S3 ();
var urlpack = require ("url");
var xmlrpc = require ("xmlrpc");
@leonjza
leonjza / cache.py
Last active July 14, 2024 11:49
Simple SQLite Cache
#!/usr/bin/python
import os
import errno
import sqlite3
import sys
from time import time
from cPickle import loads, dumps
import logging
@myusuf3
myusuf3 / banal-apps.txt
Last active August 29, 2015 14:16
Merely gathering up a list of apps that people are tired of rolling their own constantly. I would love to hear what you guys would want built out once and for all.
- banal-signup (user management)
- banal-payments (cash money)
- banal-betalist (beta list hype tools)
@TwoLeaves
TwoLeaves / init.lua
Last active March 7, 2022 18:00
Hammerspoon config
--------------------------------------------------------------------------------
-- Unsupported Spaces extension. Uses private APIs but works okay.
-- (http://github.com/asmagill/hammerspoon_asm.undocumented)
spaces = require("hs._asm.undocumented.spaces")
-- Get output of a bash command
function os.capture(cmd)
local f = assert(io.popen(cmd, 'r'))
local s = assert(f:read('*a'))
f:close()