Skip to content

Instantly share code, notes, and snippets.

View tcr's full-sized avatar
🚮
bad command or file name

Tim Ryan tcr

🚮
bad command or file name
View GitHub Profile
@micahbrich
micahbrich / flac-to-mp3.rb
Created May 21, 2011 23:40
Batch convert flac to mp3, with metadata, using ffmpeg
Dir.glob("*.flac").each do |f|
flac = "./#{f.gsub(' ', '\ ')}"
mp3 = "./#{f.gsub(' ', '\ ').chomp('.flac')}.mp3"
system("ffmpeg -i #{flac} -map_meta_data #{mp3}:#{flac} #{mp3}")
end
@fbuchinger
fbuchinger / .picasa.ini
Created July 9, 2011 18:26
.picasa.ini decoded
#==============================================================
# .picasa.ini FILE STRUCTURE
#
# reverse-engineered by Franz Buchinger <fbuchinger@gmail.com>
# licensed to the public domain
#
# Picasa Version(s): 3.8.0
#
# Changelog:
# v0.1: initial release
@tcr
tcr / summary.md
Created October 27, 2011 21:29
How can I learn Git from a low-level perspective?

Includes a description of Git including blobs, objects, trees, and explains everything through DAC graphs.

@Raynos
Raynos / weak-map.js
Last active September 18, 2019 07:49 — forked from Gozala/weak-map.js
Harmony WeakMap shim for ES5
// Original - @Gozola. This is a reimplemented version (with a few bug fixes).
window.WeakMap = window.WeakMap || (function () {
var privates = Name()
return {
get: function (key, fallback) {
var store = privates(key)
return store.hasOwnProperty("value") ?
store.value : fallback
},
@Raynos
Raynos / x.md
Created January 23, 2012 19:03
unshimmable subset of ES5

The following features of ES5 cannot be shimmed.

The ones you care about

Enumerable properties [ES3]

Using Object.defineProperty if you define a non-enumerable property on an object then for..in loops over that object will behave correctly in modern browsers but enumerate over that property in legacy browsers.

This means that code that works in modern browsers, breaks in legacy browsers.

@isaacs
isaacs / .gitconfig
Created June 8, 2012 19:01
These are my shortcuts for git.
# A bunch of the stuff above relies on this, especially the aliases.
[user]
# you probably want to change this bit.
name = isaacs
email = i@izs.me
signingkey = 0x6C481CF6
[alias]
ci = commit
st = status
br = branch
@statico
statico / gist:3172711
Created July 24, 2012 21:15
How to use a PS3 controller on Mac OS X 10.7 (Lion)

How to use a PS3 controller on Mac OS X 10.7 (Lion)

  1. Open Apple menu -> System Preferences -> Bluetooth and disable Bluetooth on Mac as well as any other nearby Macs or devices which will try to pair with and confuse the controller.

  2. Reset PS3 controller by inserting paperclip into pinhole near L2 button.

  3. Connect PS3 controller to Mac with USB cable.

  4. Enable Bluetooth.

@jiahuang
jiahuang / watchdog.c
Created November 30, 2012 05:55
ATTiny watchdog setting
uint8_t watchdog_count = 0;
ISR(WDT_vect) {
// This vector is for the watchdog timer
PORTA = PORTA | (1 << LED ); // The LED never goes on
++watchdog_count;
}
ISR(PCINT0_vect)
{
@z0w0
z0w0 / haul.md
Last active February 9, 2017 10:27
Haul, a purely functional package manager for Rust

Haul

Features

  • Purely functional
    • Different versions of packages can coexist
    • Each package must have a UUID, so packages with conflicting names can coexist
  • Build logic
    • Each package's metadata and build logic is written in a central Rust source file, package.rs
  • Dependencies are declared in the package file and will be fetched and installed before