spec
|--- apis #do not put into controllers folder.
|--- your_api_test_spec.rb
|--- controllers
|--- models
|--- factories
|--- views
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
heroku addons:add pgbackups --remote staging | |
heroku addons:add pgbackups --remote production | |
heroku pgbackups:capture --remote production | |
heroku pgbackups:restore DATABASE `heroku pgbackups:url --remote production` --remote staging |
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
#!/usr/bin/env ruby | |
# serve the contents under www/ with a web server via port 8080 and proxy all | |
# requests to /api/* to an external API | |
# Steven Wilkin | @stevebiscuit | |
require 'net/http' | |
require 'webrick' | |
require 'uri' |
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
gem 'omniauth' | |
gem 'omniauth-facebook' | |
gem 'clearance' |
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
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
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
on alfred_script(q) | |
set output_devices to {"Display Audio", "Generic USB Audio Device "} | |
set input_devices to {"Display Audio", "Generic USB Audio Device "} | |
set device_keywords to {"speakers", "headphones"} | |
tell application "System Preferences" | |
reveal anchor "output" of pane id "com.apple.preference.sound" | |
tell application "System Events" | |
tell process "System Preferences" |
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
(function (root) { | |
var type = function (o) { | |
// handle null in old IE | |
if (o === null) { | |
return 'null'; | |
} | |
// handle DOM elements |
Here are a few common tasks you might do in your templates, as they would be written in ExpressionEngine vs. Craft CMS.
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
require 'date' | |
require 'koala' | |
class BirthdayLiker | |
FACEBOOK_TOKEN = 'your_oauth_key' | |
BIRTHDAY_WORDS = %w(birthday bday birfday birth born) | |
THANKS_OPTIONS = ['Thank you!', 'Thanks!', 'Appreciate it!'] | |
DATE_TIME_FORMAT = '%Y-%m-%d' | |
def initialize(birthdate, opts={}) |
TL;DR
Create a backup:
pg_dumpall > mybackup.sql
Perform the upgrade:
sudo pg_dropcluster 9.4 main --stop
OlderNewer