Skip to content

Instantly share code, notes, and snippets.

@jakecraige
jakecraige / nice-menu-config.scss
Created July 11, 2013 15:11
Nice menu reset and configuration for a sass setup.
/**
* Reset and setup for customizing Nice Menus
* by Jake Craige with Poetic Systems
* on July 11, 2013
*/
/* ------EXAMPLE CSS FILE---------
@import "base";
@import "nice-menu-config";
"Jake Craige
" place this file in your home dir
" must install vundle in ~/.vim/bundle/ first.
" Then open up vim and type :BundleInstall
" and you should be good to go!
" Setup {{{
set nocompatible
filetype off
@jakecraige
jakecraige / script.js
Last active December 21, 2015 00:39
Set backstretch image of page from image content type in drupal, and change css on scroll down
function commercial_backstretch_setup() {
if($('.node-type-commercial-development').length > 0) {
var image = $('#content .field-image img').attr('src');
$('body').backstretch(image);
var height = $(window).scrollTop() - $('#testimonial_wrapper').offset().top
if(height > $('#content').height()) {
$('#content').height(height * -1);
}
}
module StringHelpers
refine String do
def blank?
self.to_s.strip == ""
end
def question?
self.end_with? "?"
end
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
"Jake Craige
" Setup {{{
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
set rtp+=~/Development/dotfiles/powerline/powerline/bindings/vim/
call vundle#rc()
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)
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');
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