Skip to content

Instantly share code, notes, and snippets.

View rymawby's full-sized avatar

Ry Mawby rymawby

View GitHub Profile
@rymawby
rymawby / air_packager.sh
Created September 14, 2011 15:45
Script to take a directory of swf files and create air files from them. These are not signed but will run on platforms such as set top boxes.
#!/bin/sh
mkdir packaged_air_files
for f in *.swf
do
echo "Processing $f"
mkdir packaged_air_files/dir$f
mkdir packaged_air_files/dir$f/META-INF
mkdir packaged_air_files/dir$f/META-INF/AIR
@rymawby
rymawby / svn-add-all-new-files
Created January 2, 2012 18:10
SVN add all new files (bash)
svn st | grep "^?" | awk -F " " '{print $2}' | xargs svn add
@rymawby
rymawby / tfl_updates.rb
Created January 19, 2012 15:06
Real time TFL London Tube updates - Ideal for use as a Geeklet using with GeekTool / NerdTool
require 'rexml/document'
require 'net/http'
include REXML
@location = 'http://cloud.tfl.gov.uk/TrackerNet/LineStatus'
@file = Net::HTTP.get_response(URI.parse(@location))
@xml = REXML::Document.new(@file.body)
@xml.elements.each("ArrayOfLineStatus/LineStatus") do |element|
puts "#{element[3].attribute("Name")} - #{element[5].attribute("Description")}"
end
@rymawby
rymawby / compare_lines.rb
Created January 20, 2012 15:34
Ruby script to compare two text files - analysed what lines exist in file1 that do not in file2.
#!/usr/bin/ruby
# script to compare and see what lines are in file1 but not file2
f1 = File.open('file1.txt')
f2 = File.open('file2.txt')
file1lines = f1.readlines
file2lines = f2.readlines
@rymawby
rymawby / save-mail-for-dropbox-gallery.scpt
Created February 13, 2012 10:32
Saving selected mail attachments for use with a Dropbox gallery
@rymawby
rymawby / prowly_tub_status_update.rb
Created August 14, 2012 11:38
Push TFL tube status updates to your iPhone using prowly
require 'rubygems'
require 'prowly'
require 'rexml/document'
require 'net/http'
include REXML
@location = 'http://cloud.tfl.gov.uk/TrackerNet/LineStatus'
@file = Net::HTTP.get_response(URI.parse(@location))
@xml = REXML::Document.new(@file.body)
@rymawby
rymawby / homebrew_fix_brew_update.sh
Created September 24, 2012 17:38
Fix Homebrew issue with updating when the git pull is not working
cd `brew --prefix`
git remote add origin https://github.com/mxcl/homebrew.git
git fetch origin
git reset --hard origin/master
@rymawby
rymawby / trace_all_system_capabilities.as
Created October 18, 2012 10:25
Trace all system capabilities
import flash.system.Capabilities;
trace("Capabilities.avHardwareDisable: "+Capabilities.avHardwareDisable);
trace("Capabilities.hasAccessibility: "+Capabilities.hasAccessibility);
trace("Capabilities.hasAudio: "+Capabilities.hasAudio);
trace("Capabilities.hasAudioEncoder: "+Capabilities.hasAudioEncoder);
trace("Capabilities.hasEmbeddedVideo: "+Capabilities.hasEmbeddedVideo);
trace("Capabilities.hasMP3: "+Capabilities.hasMP3);
trace("Capabilities.hasPrinting: "+Capabilities.hasPrinting);
trace("Capabilities.hasScreenBroadcast: "+Capabilities.hasScreenBroadcast);
@rymawby
rymawby / get-audio-track-from-mp4.sh
Created October 19, 2012 13:29
Get AAC audio-track from an mp4 using mp4box
mp4box -raw <track-id> <path-to.mp4>
@rymawby
rymawby / get-mp4-info.sh
Created October 19, 2012 13:30
Get mp4 track info using mp4box
mp4box -info <path-to.mp4>