Skip to content

Instantly share code, notes, and snippets.

View infinityrobot's full-sized avatar
🦁

Ritchie Blair infinityrobot

🦁
  • Infinity Robot
  • Australia
View GitHub Profile
def authorised?
true
end
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
passenger_root /usr/local/rvm/gems/ruby-1.9.2-p0/gems/passenger-3.0.2;
passenger_ruby /home/youni/.rvm/wrappers/ruby-1.9.2-p0/ruby;
# user deploy;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid /var/run/nginx.pid;
class TimetablesController < ApplicationController
# FILTERS
before_filter :authenticate_user!, :except => [:show, :about]
# SHOW
def show
if user_signed_in? && current_user.timetable
@timetable_items = current_user.timetable
elsif user_signed_in? && !current_user.timetable || !user_signed_in?
create_table "timetable_events", :force => true do |t|
t.integer "timetable_item_id"
t.integer "timetable_event_type_id"
t.string "location"
t.string "code"
t.time "start_time"
t.integer "day"
t.decimal "length", :precision => 3, :scale => 1
t.text "notes"
t.datetime "created_at"
// I have included a few steps in here to show the flow I normally do to get things working.
// Keep in mind I'm still a massive noob so there may be a better way to do all of this :/
// ...
// Class definition and imports
// STEP 1: Declare vars in the controller @interface
@interface MapViewController : UIViewController <MKMapViewDelegate, UISearchBarDelegate> {
// ...
#!/usr/bin/env ruby
#
# Originally written by http://redartisan.com/tags/csv
# Added and minor changes by Gavin Laking
# Rewritten by Andrew Bennett for Ruby 1.9
#
# Usage: ruby csv_to_fixture.rb file.csv [--json]
#
# "id","name","mime_type","extensions","icon_url"
# "1","unknown","unknown/unknown","||","/images/icon/file_unknown.gif"