Skip to content

Instantly share code, notes, and snippets.

View rymawby's full-sized avatar

Ry Mawby rymawby

View GitHub Profile
@rymawby
rymawby / convert-aac-to-mp3.sh
Created October 19, 2012 15:56
Convert aac to mp3 using ffmpeg
ffmpeg -i <audio.aac> -acodec libmp3lame <audio.mp3>
### Basic routes ###
Rails 3:
# singular resource
resource :account
# resources with addition member & collection actions
resources :games do
get :download, :on => :member
get :favourites, :on => :collection
@rymawby
rymawby / get-jira-summary.sh
Created November 2, 2012 10:33
Get Jira Summary
jira.sh -s <jira-url> --user <username> --password <password> --action getFieldValue --issue "<issue-id>" --field 'summary'
@rymawby
rymawby / fix_flashbuilder_crash.sh
Last active December 14, 2015 15:19
Fix for metadata issue when booting FlashBuilder 4.6
rm /workspace/.metadata/.plugins/org.eclipse.core.resources/.snap
@rymawby
rymawby / simple_http_server.sh
Last active December 16, 2015 07:19
SImple HTTP Server
python -m SimpleHTTPServer 8080
@rymawby
rymawby / start_solr.sh
Last active December 16, 2015 09:29
Start solr
rake sunspot:solr:start
@rymawby
rymawby / flv_to_mpg_ffmpeg.sh
Last active December 16, 2015 13:29
Convert flv to mp4 using ffmpeg
ffmpeg -i FILENAME.flv -qscale 0 -ar 22050 -vcodec libx264 FILENAME.mp4
@rymawby
rymawby / devise_forms.rb
Last active December 16, 2015 14:59
Allow Devise forms in any controller
def resource_name
:user
end
def resource
@resource ||= User.new
end
def devise_mapping
@devise_mapping ||= Devise.mappings[:user]
@rymawby
rymawby / convert_querystring_to_hash.rb
Last active December 16, 2015 22:39
Convert query string into Hash
CGI::parse(query_string)
# OR
Rack::Utils.parse_nested_query(query_string)
# Rack one does them more in keeping with how params is formed - CGI:parse seems to add values to an array within the hash
@rymawby
rymawby / how_long_ago_in_words.rb
Last active December 17, 2015 03:58
How long ago in words - humanised in Rails.
distance_of_time_in_words(from, to)