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
$(function(){ | |
if (!Modernizr.input.placeholder){ | |
$('input[type=text]').clearValue(); | |
} | |
}); | |
$.fn.clearValue = function() { | |
var element = this; | |
var defaultStr = $(this).attr('placeholder'); | |
$(this).val(defaultStr); | |
return this.focus(function() { |
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
# make sure engine classes load first. | |
# @see http://stackoverflow.com/questions/5045068/extending-controllers-of-a-rails-3-engine-in-the-main-app/5100825 | |
require 'active_support/dependencies' | |
module ActiveSupport::Dependencies | |
alias_method :require_or_load_without_multiple, :require_or_load | |
def require_or_load(file_name, const_path = nil) | |
if file_name.starts_with?(Rails.root.to_s + '/app') | |
relative_name = file_name.gsub(Rails.root.to_s, '') | |
@engine_paths ||= CologyCom::Application.railties.engines.collect{|engine| engine.config.root.to_s } | |
@engine_paths.each do |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
<%= form_for(@promotion, :html => { :multipart => true }) do |f| %> | |
<%= select_tag 'owner', grouped_owners_for_select %> | |
<% 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
(($) -> | |
$.fn.valign = (max_width, max_height) -> | |
@each (i) -> | |
$.each $(this).children(), (j,el) -> | |
img = $(el).children()[0] | |
ph = Math.floor((max_width - $(img).width()) / 2) | |
pv = Math.floor((max_height - $(img).height()) / 2) | |
div = $('<div></div>').css('padding',"#{pv}px #{ph}px") | |
$(img).wrap(div) |
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 /Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent) | |
ffversion = new Number(RegExp.$1) | |
if ffversion < 3.5 | |
head = document.getElementsByTagName("head")[0] | |
el = document.createElement("link") | |
el.type = "text/css" | |
el.rel = "stylesheet" | |
el.href = "/assets/firefox.css" | |
el.media = "screen" | |
head.appendChild el |
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
$.each($('textarea.textile'),function(i,el){ | |
TextileEditor.initialize($(el).attr('id')); | |
}); |
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
<!-- To be included directly before closing body tag --> | |
<script> | |
$(document).ready(function(){ | |
var client_ids = $('select#ctl00_ctl00_placeHolderMain_cphMainContent_cbClient option').map(function() { | |
return /\d+/.exec($(this).val()); | |
}).get().join(',') | |
var sp = document.createElement('script'); | |
sp.type = 'text/javascript'; | |
sp.src = "//www.paycor.com/syndicated/online-home.js?client_ids=" + client_ids; |
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
.. # last edit (magic dot) | |
:& # last substitute | |
:%& # last substitute every line | |
:%&gic # last substitute every line confirm | |
g% # normal mode repeat last substitute | |
g& # last substitute on all lines | |
@@ # last recording | |
@: # last command-mode command | |
:!! # last :! command | |
:~ # last substitute |
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
set nocompatible " be iMproved | |
filetype off " required! | |
call pathogen#infect() | |
if has("gui_macvim") | |
" let Vundle manage Vundle | |
" set rtp+=~/.vim/bundle/vundle/ | |
" call vundle#rc() | |
" Bundle 'gmarik/vundle' |
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 'yaml' | |
namespace :pg do | |
namespace :mac do | |
def conf | |
@conf ||= YAML.load_file("#{Rails.root}/config/database.yml") | |
end | |
def username |
OlderNewer