- Go to Digital Ocean
- Create new droplet
- London
- Ubuntu
- No apps
- Add SSH keys
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
# from https://github.com/discourse/discourse/blob/21e08a423e8839c6bacb4ee688b924a4fb71113f/lib/middleware/turbo_dev.rb | |
# lib/middleware/turbo_dev.rb | |
module Middleware | |
# Cheat and bypass Rails in development mode if the client attempts to download a static asset | |
# that's already been downloaded. | |
# |
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
// | |
// Typical Prototype composure in JS; This is the classical way of creating and | |
// using objects in JS. | |
// | |
// "Super" or "Parent" object prototype | |
function Cat(color) { | |
this.color = color; | |
this.saying = 'meowwww'; | |
} |
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
Mountain Lion Web Sharing | |
Apache/WebSharing | |
The first difference in the new OS X 10.8 is the dropping of the GUI option to turn on Web Sharing in the System Preferences, it may be gone but Apache is definitely installed in the lower level of the OS and ready to go. | |
No Web Sharing Option in System Preferences | |
Apache is pre-installed and needs to be enabled via the command line - /Applications/Utilities/Terminal |
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
describe 'App.HeaderModule', -> | |
beforeEach -> | |
@headerModule = window.App.HeaderModule | |
it 'should exist', -> | |
expect(@headerModule).not.toBeUndefined() | |
describe 'starting', -> |
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/python | |
from pyquery import PyQuery as pq | |
import re | |
import datetime | |
print datetime.datetime.now().strftime('%c') | |
doc = pq(url='http://www.beermenus.com/places/4733-the-ruck') |
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 'spec_helper' | |
# Bustle is a pubsub system used for activity streams: | |
# https://github.com/fredwu/bustle | |
# | |
# Here when a person follows another (or a discussion, for instance), the observer wires | |
# up pubsub between them for future activity notifications. The Follow model knows nothing | |
# about the implementation choices for the pubsub system. | |
describe FollowObserver do | |
subject { FollowObserver.instance } |
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
# Gemfile | |
gem "puma" | |
# Procfile | |
web: bundle exec puma -p $PORT -e $RACK_ENV -C config/puma.rb | |
# add to config block config/environments/production.rb | |
config.threadsafe! | |
# get rid of NewRelic after_fork code, if you were doing this: |
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
class PostsController < ActionController::Base | |
def create | |
Post.create(post_params) | |
end | |
def update | |
Post.find(params[:id]).update_attributes!(post_params) | |
end | |
private |
OlderNewer