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
| angular.module('CrowdSound').directive 'csChart', () -> | |
| restrict: "E" | |
| scope: | |
| question: "=" | |
| index: "=" | |
| link: (scope, element, attrs) -> | |
| scope.data = [] | |
| class PieChart | |
| constructor: (element) -> |
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
| angular.module('CrowdSound').directive 'csPie', () -> | |
| restrict: "E" | |
| scope: | |
| question: "=" | |
| index: "=" | |
| link: (scope, element, attrs) -> | |
| scope.data = [] | |
| class PieChart | |
| constructor: (element, data) -> |
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
| .factory("Session", () -> | |
| Session = | |
| user: "john" | |
| show_user: () -> | |
| console.log @new_auth.user | |
| connection: new Firebase("https://pitchclub.firebaseIO.com/rooms") | |
| new_auth: {} | |
| login: () -> | |
| firebase = new Firebase("https://pitchclub.firebaseIO.com/rooms") | |
| return_user = {} |
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 [ -d /Applications/MacVim.app/ ]; then | |
| # use MacVim over built-in Mac OS version | |
| export PATH="/Applications/MacVim.app/Contents/MacOS:$PATH" | |
| alias mvim='MacVim' | |
| alias vim='Vim' | |
| alias vi='Vim' | |
| export EDITOR='/Applications/MacVim.app/Contents/MacOS/Vim' | |
| alias vimdiff="Vim -d" | |
| fi |
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
| //layouts/application.html.erb | |
| <!DOCTYPE html> | |
| <!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> | |
| <!--[if lt IE 7 ]> <html class="ie6" lang="en"> <![endif]--> | |
| <!--[if IE 7 ]> <html class="ie7" lang="en"> <![endif]--> | |
| <!--[if IE 8 ]> <html class="ie8" lang="en"> <![endif]--> | |
| <!--[if (gte IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]--> | |
| <head> | |
| <meta charset="utf-8" /> |
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 Company < ActiveRecord::Base | |
| attr_accessible :cb_url, :name, :url | |
| validates_presence_of :name, :cb_url | |
| validates_uniqueness_of :name | |
| has_many :events, :uniq => true | |
| end | |
| @records = Company.joins(:events).where(:events => { :date => ("2013-1-22")..("2013-3-22") } ).count | |
| 1.9.3p374 :002 > @records = Company.joins(:events).where(:events => { :date => ("2013-1-22")..("2013-3-22") } ).count |
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 process_datum | |
| self.raw_data.each do |datum| | |
| company = Company.where(name: datum[1]).first_or_create(url: datum[2], cb_url: datum[3]) | |
| a = datum[0].split("/").each_with_index {|e,i| e.insert(0,"20") if i == 1}.reverse.map {|e| e.to_i} | |
| date = Date.new(a[0], a[1]) | |
| event = Event.where(funding_type: datum[4], date: date, value: datum[5]).first_or_create | |
| 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
| %nav.top-bar | |
| %ul.title-area | |
| %li.name | |
| %h1 | |
| = link_to "RubyWhiteBelts", root_path | |
| %li.toggle-topbar.menu-icon | |
| %a{:href=>"#"} | |
| %span Menu | |
| %section.top-bar-section | |
| %ul.right |
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 TicTacToe | |
| attr_accessor :board, :turns | |
| def initialize | |
| @turns = 0 | |
| @board = [] | |
| 9.times 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
| app.rb calls | |
| use OmniAuth::Builder do | |
| provider :twitter, ENV['TWITTER_CONSUMER_KEY'], ENV['TWITTER_CONSUMER_SECRET'] | |
| end | |
| and cat ~/.bashrc | |
| is |
NewerOlder