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
| app = angular.module('app', ['ngResource']) | |
| app.factory("Result", ["$resource", ($resource) -> | |
| $resource("/scrapes/:scrape_id/results/:id", {scrape_id: "@scrape_id", id: "@id"}) | |
| ]) | |
| app.controller("MainCtrl", ['$scope','Result',($scope,Result)-> | |
| $scope.scrape = {id: 1} | |
| $scope.results = [] | |
| $scope.getResults = (-> |
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 destroy | |
| warden.authenticate!(:scope => resource_name, :recall => "#{controller_path}#failure") | |
| current_user.update_column(:authentication_token, nil) | |
| sign_out | |
| render :status => 200, | |
| :json => { :success => true, | |
| :info => "Logged out", | |
| :csrfParam => request_forgery_protection_token, | |
| :csrfToken => form_authenticity_token |
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
| <!DOCTYPE HTML> | |
| <html lang="en-US"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title></title> | |
| <base href="http://localhost:3000/proxy/"> | |
| </head> | |
| <body> | |
| <p>Open the console and notice the following error | |
| <code> |
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
| app = angular.module('Simple') | |
| @SimpleCtrl = ['$scope', ($scope) -> | |
| $scope.data = {output: 'hello world'} | |
| doSomething = () -> | |
| $scope.data.output => "hello application." | |
| ] | |
| ### |
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 ClientController < ApplicationController | |
| respont_to :html | |
| def show | |
| @client = Client.find(params[:id]) | |
| respond_with @client | |
| end | |
| end |
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
| require 'capistrano/ext/multistage' | |
| require "rvm/capistrano" | |
| require "bundler/capistrano" | |
| require "delayed/recipes" | |
| require 'new_relic/recipes' | |
| set :rvm_ruby_string, ENV['GEM_HOME'].gsub(/.*\//,"") # Read from local system | |
| set :default_environment, { | |
| 'PATH' => "/home/rails/.rvm/gems/ruby-1.8.7-p370@appname/bin:/home/rails/.rvm/bin:/home/rails/.rvm/rubies/ruby-1.8.7-p370/bin:$PATH", |
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
| require 'rspec' | |
| class Risk | |
| def code(user) | |
| user_site = user.site[0..1] | |
| if department | |
| department_name = department.name[0..1] | |
| end | |
| [user_site,department_name,"001"].compact.join('-').upcase |
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 active_tab | |
| link_to("Homepage", root_path, :class => ("active" if current_page? root_path)) | |
| end |
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
| /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics. |
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
| if @grouped | |
| object @days | |
| node do |date| | |
| node(:changed) { date[:changed].format } | |
| node(:balance) { date[:balance].format } | |
| child date[:transactions] => :transactions do | |
| extends 'transactions/show' | |
| end | |
| node(:date) { date[:date] } |