Skip to content

Instantly share code, notes, and snippets.

@uberscientist
uberscientist / 1frameanimate.js
Created March 15, 2012 00:20
Gen. image seq. from dotty Redis data
var redis = require('redis'),
fs = require('fs'),
Canvas = require('canvas');
var db = redis.createClient(),
canvas = new Canvas(500, 300),
ctx = canvas.getContext('2d');
function pad(number, length) {
var str = '' + number;
@uberscientist
uberscientist / gist:3279838
Created August 7, 2012 00:15
SaaS BDD assignment
--------------------------------------------------------------------------------
Test passed. (+0.2)
--------------------------------------------------------------------------------
The following required failures were not detected:
- all ratings or checkboxes selected
with the following modifications:
- results = [G, PG-13] movies
| Disabling profiles...
| Disabling profiles...
| Feature: display list of movies filtered by MPAA rating
@uberscientist
uberscientist / gist:7269823
Created November 1, 2013 18:37
Tumblr post note scrapr in python
#!/usr/bin/env python
# Script to scrape notes from tumblr post
# 10/08/2013
# Christopher Toledo
import urllib2
import sets
import re
from time import sleep
@uberscientist
uberscientist / gist:7391978
Created November 10, 2013 00:22
map array
var files = ['midi01', 'nomatch', 'gerrhihoos', 'midi29s', 'sadfmidi', '3333s'];
var patt = new RegExp('midi', 'i');
var matches = files.map(function(file) {
if(patt.exec(file)) {
return file;
}
});
@uberscientist
uberscientist / gist:baa627f9779d2d08ca87
Last active August 29, 2015 14:05
msp430-elf-gcc ISR format

The error:

main.c: In function 'Timer_A':
main.c:150:28: error: MSP430 builtin functions only work inside interrupt handlers
   __bic_SR_register_on_exit(CPUOFF);      // Clear CPUOFF bit from 0(SR)
                            ^
makefile:23: recipe for target 'main.o' failed

Here's the code:

@uberscientist
uberscientist / gist:faba7f2050bf94d8176c
Created August 14, 2014 16:46
msp-datalogger makefile
# Makefile for MSP430 datalogger project
# Christopher Toledo (uberscientist@gmail.com)
# May 27th, 2014
CC = msp430-elf-gcc
MCU = msp430g2755
DRIVER = rf2500
TARGET = datalogger
INC_DIR = /home/nak/Msp430GCCopensource/include
INCLUDES = -I $(INC_DIR) -I MMC_lib -I fatfs
@uberscientist
uberscientist / gist:0fb08a8f4e26de094ec5
Created December 22, 2014 23:34
env STEAM_RUNTIME=0 /usr/bin/steam
Running Steam on arch rolling 64-bit
STEAM_RUNTIME is disabled by the user
Installing breakpad exception handler for appid(steam)/version(1419038262)
Installing breakpad exception handler for appid(steam)/version(1419038262)
Installing breakpad exception handler for appid(steam)/version(1419038262)
Gtk-Message: Failed to load module "canberra-gtk-module"
Gtk-Message: Failed to load module "canberra-gtk-module"
Gtk-Message: Failed to load module "canberra-gtk-module"
Gtk-Message: Failed to load module "canberra-gtk-module"
Installing breakpad exception handler for appid(steamwebhelper)/version(20141219150336)
from moviepy.editor import *
import numpy as np
file1 = "1.mp4"
file2 = "2.mp4"
clip1 = VideoFileClip(file1)
clip2 = VideoFileClip(file2)
# cut duration in seconds
@uberscientist
uberscientist / gist:8a89ff8b7810275f322f
Created July 3, 2015 19:56
quick gist of dreaming video
# could be a lot more readable if I just broke the deepdream out into a module...
import os
#Copied from deepdream iPython notebook
# imports and basic notebook setup
from cStringIO import StringIO
import numpy as np
import scipy.ndimage as nd
import PIL.Image
from google.protobuf import text_format
#Set working directory
#dir_SM <- "F:/Kaitlyn_Toledo_Data/RMP_Project/SMData"
dir_SM <- "/home/nak/kate-R/try1"
library(reshape2)
library(ggplot2)
# We an use the recursive option to get all the CSV files
csv_filenames <- list.files(dir_SM,
recursive=TRUE,