This file contains hidden or 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
| ## I have a member class, it has a method on it called facebook, you will also need the user_photos permission | |
| # | |
| # def facebook | |
| # @facebook ||= Koala::Facebook::API.new facebook_auth.credentials.token if facebook? | |
| # end | |
| # | |
| ## | |
| user=User.last |
This file contains hidden or 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
| # rc: Rails console | |
| alias rc="rails c" | |
| # debugme: touch tmp/debug.txt | |
| alias debugme="touch tmp/debug.txt" | |
| # rgm: Generate rails migrations | |
| function rgm() { | |
| local fileopener file |
This file contains hidden or 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
| PetrescueAdmin::Application.routes.draw do | |
| devise_for :users | |
| root to: redirect("/users/sign_in") | |
| resources :groups, only: [:new, :create, :show] | |
| get 'rescue_directory' => 'groups#index' | |
| get 'rescue_directory/:state' => 'groups#list_by_state' | |
| resources :listings, only: [:index] |
This file contains hidden or 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
| def edit | |
| if current_user.vetter? | |
| if @mission.vet.nil? | |
| @mission.start_vetting | |
| @mission.build_vet | |
| end | |
| end | |
| end | |
| it do |
This file contains hidden or 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(){ | |
| FRONTIER_REGEX = /^\/thefrontiergroup\//; | |
| INBOX_GITHUB = /^\/inbox\/notifications/; | |
| if(window.location.pathname.match(INBOX_GITHUB)){ | |
| var actions, button, markasread; | |
| markasread = $('.list .minibutton'); | |
| button = $('<button>'); |
This file contains hidden or 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 Diablo3 | |
| def self.pick_my_class(option1,option2) | |
| options = [] | |
| 18.times do | |
| options.push(option1) | |
| options.push(option2) | |
| end | |
| options.push('QUIT LIFE') | |
| options.shuffle! | |
| # puts options.sample |
This file contains hidden or 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
| jQuery ($) -> | |
| $('#add-user').on 'click', (e) -> | |
| userId = $('#group_user_id').val() | |
| groupId = $('#group_id').val() | |
| data = | |
| group_id : groupId | |
| user_id : userId | |
| $.post "/admin/group_users", data, (data)-> | |
| if data == "error" |
This file contains hidden or 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
| module Apathy | |
| extend ActiveSupport::Concern | |
| def care_factor | |
| 0 | |
| end | |
| end | |
| class Dan |
This file contains hidden or 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
| module Apathy | |
| extend ActiveSupport::Concern | |
| def care_factor | |
| 0 | |
| end | |
| end | |
| class Dan |
This file contains hidden or 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 Driver | |
| .... | |
| after_destroy :set_new_current_driver_to_insurance_detail | |
| protected | |
| def set_new_current_driver_to_insurance_detail | |
| @insurance_detail = self.insurance_detail | |
| @insurance_detail.update_attribute(:current_driver, @insurance_detail.drivers.first) if @insurance_detail.drivers.any? and @insurance_detail.current_driver_id == self.id |