Skip to content

Instantly share code, notes, and snippets.

View radavis's full-sized avatar

Richard Davis radavis

View GitHub Profile

Redirect all Requests to Another Application

We recently decommisioned one of our applications after it was replaced with a shiny new one with a new hostname. In order to make the transistion seamless for past users, we needed a way to redirect all traffic to the new URL.

Rails makes this quite easy to do.

class ApplicationController
  before_filter :redirect_all_requests
 
@radavis
radavis / example.md
Last active September 19, 2015 13:31
HTML Rendered HTML
<h1>Heading level 1</h1> # Heading level 1
<h2>Heading level 2</h2> ## Heading level 2
<h3>Heading level 3</h3> ### Heading level 3
<h4>Heading level 4</h4> #### Heading level 4
<h5>Heading level 5</h5> ##### Heading level 5
<h6>Heading level 6</h6> ###### Heading level 6
SUITS = ["♠", "♥", "♦", "♣"]
$( document ).ready(function() {
//whatever
});
// Shorthand for $( document ).ready()
$(function() {
//whatever
});
@radavis
radavis / playlist.md
Last active August 29, 2015 14:24
Ship-it Saturday Playlist (July 2015)
Artist Album
Apparat Walls
Bionaut Lubricate Your Living Room
Bonobo Animal Magic, Days to Come
Emancipator
Guy Boratto Chromophobia
Kyson Blackstone
Mokhov Halcyon Days
Pretty Lights
{
"font_size": 22.0,
"show_full_path": true,
"tab_size": 2,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"ensure_newline_at_eof_on_save": true,
"dictionary": "Packages/Language - English/en_US.dic",
"spell_check": true,
"folder_exclude_patterns":
@radavis
radavis / .railsrc
Last active March 22, 2024 16:42
Using .railsrc and a Rails Template
# ~/.railsrc
--database=postgresql
--skip-bundle
--skip-spring
--skip-test-unit
--skip-turbolinks
--template=/path/to/rails_template.rb
// FFmpeg settings for vimeo.com
// =============================
// Trying to find the best settings for encoding videos as described here: http://vimeo.com/help/compression
//
// Input file: MTS
// Video: H264, 1920x1080, 50fps
// Audio: A52 Audio (aka AC3), Stereo, 48kHz, 256kbps
ffmpeg -i input.mts -vcodec libx264 -acodec aac -strict experimental -vpre hq -s hd720 -b 5000k -ab 320k -r 25 -g 25 -threads 0 output.mp4
@radavis
radavis / android-backup.md
Created June 2, 2015 16:29
Backup Android Phone

Backup Android Phone

  • Grab the Android SDK Tools
  • Unpack them in your home folder and add them to the path
# .zshrc or .bash_profile

# android
export PATH="$PATH:$HOME/android-sdk-macosx/tools"