This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plist Parser Class | |
* | |
* Usage: | |
* ====== | |
* $plist = Plist::from_file("~/Music/iTunes/iTunes Music Library.xml"); | |
* print_r($plist->as_array()); | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Simple sound playback using ALSA API and libasound. | |
* | |
* Compile: | |
* $ cc -o play sound_playback.c -lasound | |
* | |
* Usage: | |
* $ ./play <sample_rate> <channels> <seconds> < <file> | |
* | |
* Examples: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put this in config/initializers/carrierwave.rb | |
module CarrierWave | |
module MiniMagick | |
def quality(percentage) | |
manipulate! do |img| | |
img.quality(percentage) | |
img = yield(img) if block_given? | |
img | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: | |
# [sudo] gem install mechanize | |
# ruby tumblr-photo-ripper.rb | |
require 'rubygems' | |
require 'mechanize' | |
# Your Tumblr subdomain, e.g. "jamiew" for "jamiew.tumblr.com" | |
site = "doctorwho" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <IOKit/IOKitLib.h> | |
#include <IOKit/usb/IOUSBLib.h> | |
#include <IOKit/hid/IOHIDKeys.h> | |
CFStringRef find_serial(int idVendor, int idProduct) { | |
CFMutableDictionaryRef matchingDictionary = IOServiceMatching(kIOUSBDeviceClassName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# convert all .wav files to ogg/vorbis | |
for x in *.wav; do ffmpeg -i "$x" "`basename "$x" .wav`.ogg" -acodec vorbis; done | |
# convert all .mp3 files to ogg/vorbis | |
for x in *.mp3; do ffmpeg -i "$x" "`basename "$x" .mp3`.ogg" -acodec vorbis; done | |
#convert all .wav files to .mp3 | |
for x in *.wav; do ffmpeg -i "$x" "`basename "$x" .wav`.mp3"; done | |
#convert all .mp3 files to .wav |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIDeviceHardware.h | |
// | |
// Used to determine EXACT version of device software is running on. | |
#import <Foundation/Foundation.h> | |
@interface UIDeviceHardware : NSObject | |
- (NSString *) platform; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def read_m3u8(m3u8) | |
File.open(m3u8, 'r') do |file| | |
keyfile = nil | |
iv = 0 | |
file.each_line do |line| | |
line.chomp! | |
if line =~ /^#EXT-X-KEY:METHOD=AES-128,URI="(.*?)"(,IV=0x(.*))?/ | |
keyfile = $1 | |
if $2 | |
iv = $3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
2012-03-26 Forked from duncanbeevers' sc-dl.js : https://gist.github.com/2157987 | |
**/ | |
(function(document) { | |
var link = document.createElement("a"), | |
span = document.createElement("span"), | |
slug = document.querySelector("#main-content-inner img[class=waveform]").src.match(/\.com\/(.+)\_/)[1], | |
mp3 = document.querySelector("em").innerText + ".mp3"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" > "lolwut.mp4.json" |
OlderNewer