Skip to content

Instantly share code, notes, and snippets.

View mmmurf's full-sized avatar

Matt Murphy mmmurf

  • San Francisco, CA
View GitHub Profile
@mmmurf
mmmurf / morse.js
Last active August 29, 2015 14:08 — forked from eholk/morse.js
function MorseNode(ac, rate) {
// ac is an audio context.
this._oscillator = ac.createOscillator();
this._gain = ac.createGain();
this._gain.gain.value = 0;
this._oscillator.frequency.value = 750;
this._oscillator.connect(this._gain);
@mmmurf
mmmurf / redate.rb
Last active September 15, 2015 23:37
script to fix the created datestamp on files rescued from snapjoy's end of life backup downloads. This makes them show up in the proper order in Carousel
# this script fixed the ordering in carousel of may snapjoy files.
# works on OSX
require 'date'
Dir.glob("./**/*.jpeg").each do |f|
next if f =~ /nknown/
m = /(?<serial>\d{0,6})-(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/.match(f)
d = DateTime.new(m['year'].to_i, m['month'].to_i, m['day'].to_i) + Rational(m['serial'].to_i, 86400)