Skip to content

Instantly share code, notes, and snippets.

View benlangfeld's full-sized avatar

Ben Langfeld benlangfeld

View GitHub Profile
function UpdateQuestions() {
console.log("Updating Questions...");
}
require 'optparse'
options = {}
options[:samplerate] = 44100.0
options[:transform] = :fft
option_parser = OptionParser.new do |opts|
opts.banner = "Usage: ruby transform.rb -p path_to_input_file [-r samplerate] [--plot]"
opts.on("-r", "--samplerate SAMPLERATE", Float, "Specify the sample rate of the generated signal") do |r|
options[:samplerate] = r
ActionView::Helpers::AssetTagHelper.register_javascript_expansion :jquery => ['jquery', 'jquery-ui', 'rails']
ActiveSupport.on_load(:action_view) do
ActiveSupport.on_load(:after_initialize) do
ActionView::Helpers::AssetTagHelper::register_javascript_expansion :defaults => ['jquery', 'jquery-ui', 'rails']
end
end
var countyOptionsTemplate = new EJS({text: "<option value=''></option><% for(var i=0; i<data.length; i++) { %><option value='<%= data[i]['county']['id'] %>'><%= data[i]['county']['name'] %></option><% } %>"});
var cityOptionsTemplate = new EJS({text: "<option value=''></option><% for(var i=0; i<data.length; i++) { %><option value='<%= data[i]['city']['id'] %>'><%= data[i]['city']['name'] %></option><% } %>"});
function GetScopedCounties(e) {
var selectedState = $('#LocationState').val();
if (!selectedState)
return;
var countiesPath;
if (selectedState) {
countiesPath = '/states/' + selectedState + '/counties.json';
module ActiveRecord
# = Active Record Through Association Scope
module Associations
module ThroughAssociationScope
protected
def aliased_through_table_name
@reflection.table_name == @reflection.through_reflection.table_name ?
Base.connection.quote_table_name(@reflection.through_reflection.table_name + '_join') :
1: .campaign-data-group
2: %h3
3: Polling by
4: = CallCampaign.human_enum_name :query_type, call_campaign.query_type
5: - if permitted_to? :edit, call_campaign
6: = link_to t("web_app_theme.edit", :default=> "Edit"), send("edit_#{call_campaign.class.to_s.tableize.singularize}_path", call_campaign), :class => "dialog_link", :"data-title" => "Edit #{call_campaign.name} Targets"
7: - case call_campaign.query_type
# coding: utf-8
class TransliterationController < ApplicationController
def view
end
def result
if request.post?
@errors = []
@result = transliterate(:script, :text);
class CallCampaign < ActiveRecord::Base
has_many :campaign_targets, :autosave => true
has_many :call_lists, :through => :campaign_targets
has_many :phone_numbers, :through => :call_lists
end
module LayoutHelper
def title(page_title, show_title = true)
content_for(:title) { page_title.to_s }
@show_title = show_title
end
def show_title?
@show_title
end
irb(main):001:0> $:
=> ["/Users/simonmurphy/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/site_ruby/1.9.1", "/Users/simonmurphy/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/site_ruby/1.9.1/x86_64-darwin10.4.0", "/Users/simonmurphy/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/site_ruby", "/Users/simonmurphy/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/vendor_ruby/1.9.1", "/Users/simonmurphy/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/vendor_ruby/1.9.1/x86_64-darwin10.4.0", "/Users/simonmurphy/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/vendor_ruby", "/Users/simonmurphy/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1", "/Users/simonmurphy/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/x86_64-darwin10.4.0"]