Skip to content

Instantly share code, notes, and snippets.

( () ->
#Protects views where angular is not loaded from errors
if typeof angular == 'undefined'
return
module = angular.module 'NativeNavigation', []
module.factory 'NativeNavigation', () ->
.retailers
.col-1
=link_to 'Amazon', 'http://amazon.com'
=link_to 'Best Buy', 'http://amazon.com'
.col-2
=link_to 'Dick\'s Sporting Goods', 'http://amazon.com'
=link_to 'Fry\'s', 'http://amazon.com'
.col-3
match '/reports/autocomplete/:column_name' => 'reports#autocomplete', as: :reports_autocomplete
=label_tag :school_district, "School District"
= hidden_field_tag :school_district,
'',
:class => 'select2 ajax',
:data => { :source => reports_autocomplete_path('schooldistrict'), :column => 'schooldistrict' }
def autocomplete
render :json => autocomplete_for_column(params[:column_name])
end
def autocomplete_for_column(column_name)
#zipcode and mls num doesnt work
valid_names = %w(agentlist_fullname officelist_officename officesell_officename schooldistrict)
if valid_names.include? column_name
Property.select(column_name).where("#{column_name} LIKE ?", "%#{params[:q]}%").uniq
def autocomplete
render :json => autocomplete_for_column(params[:column_name])
end
def autocomplete_for_column(column_name)
#zipcode and mls num doesnt work
valid_names = %w(agentlist_fullname officelist_officename officesell_officename schooldistrict)
if valid_names.include? column_name
Property.select(column_name).where("#{column_name} LIKE ?", "%#{params[:q]}%").uniq
function watermarkIt(myArray, color) {
for(var i=0; i<myArray.length; i++) {
$(myArray[i][0]).watermark(myArray[i][1], {color: color});
}
}
// How to Use
watermarkIt( [
['#edit-submitted-full-name', 'Full Name'],
['#edit-submitted-email-address', 'Email Address'] ], '#000');
class Airship
# name and alert key
SupportedDevices = { ios: "aps", android: "android" }
def initialize(application_key: 'application-key',
application_secret: 'application-secret',
mester_secret: 'master-secret',
logger: Rails.logger,
request_timeout: 5)
"Jake Craige
" Setup {{{
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
set rtp+=~/Development/dotfiles/powerline/powerline/bindings/vim/
call vundle#rc()
class Phrase
def initialize(string)
@words = string.downcase.scan(/\w+/)
end
def word_count
@words.inject({}) do |results, word|
results.merge!({ word => 1 }) { |_, old, _| old + 1 }
end
end