This file contains 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
/* | |
* Scale all textareas dynamically on the page | |
* Requires Prototype | |
*/ | |
function scaleTextareas(){ | |
$$('textarea').each(function(t){ | |
t.style.height = Math.floor($F(t).split('\n').inject(1, function(m, s){ | |
return m += (s.length/(t.offsetWidth/10)) + 1; | |
})) + 8 + 'em'; | |
}); |
This file contains 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 'open3' | |
describe 'my_script' do | |
def run *args | |
options = args.extract_options! | |
args.unshift './my_script' | |
out = err = '' | |
Open3.popen3(args.join(' ')) do |i, o, e| | |
i.write options[:stdin] |
This file contains 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
# == a smarter way to pluralize | |
# | |
# Accepts an integer as an optional argument | |
# >> "actress".smart_pluralize | |
# => "actresses" | |
# >> "guitar".smart_pluralize(1) | |
# => "guitar" | |
# >> "monkey".smart_pluralize(2) | |
# => "monkeys" | |
# |
This file contains 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
* keep people working on internal projects, assign and schedule the work | |
* dont look desperate, dont have immediate availability | |
* can tell a client you can 'shuffle internal projects' to accomodate them | |
* online ads dont work well | |
* referrals instead | |
* do a great job every single time | |
* voice calls important | |
* when people call you call them back |
This file contains 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
/* | |
* Scale all textareas dynamically on the page | |
* Requires JQuery | |
*/ | |
function scaleTextareas() { | |
$('textarea').each(function(i, t){ | |
var m = 0; | |
$($(t).val().split("\n")).each(function(i, s){ | |
m += (s.length/(t.offsetWidth/10)) + 1; | |
}); |
This file contains 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
udo apt-get install screen vim git-core mysql-server libmysqlclient15-dev build-essential libssl-dev libreadline5-dev zlib1g-dev ruby-full rubygems libtiff4 ghostscript liblcms1 libexif12 libxml2 zlib1g bzip2 imagemagick libmagick9-dev postfix apache2 libapache2-mod-passenger sqlite3 libsqlite3-dev |
This file contains 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
$().ready(function(){ | |
// Instant Search | |
$('#q').keyup(function(){ | |
$('.search_item').each(function(){ | |
var re = new RegExp($('#q').val(), 'i') | |
if($(this).children('.search_text')[0].innerHTML.match(re)){ | |
$(this).show(); | |
}else{ | |
$(this).hide(); | |
}; |
This file contains 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
// Search hint | |
$($('#q')[0]).addClass('search-hint'); | |
$($('#q')[0]).val('Search'); | |
$('#q').focus(function(){ | |
if ($(this).val() == 'Search'){ | |
$(this).removeClass('search-hint'); | |
$(this).val(''); | |
} | |
}); | |
$('#q').blur(function(){ |
This file contains 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
# Check for maintenance file and redirect all requests | |
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f | |
RewriteCond %{SCRIPT_FILENAME} !maintenance.html | |
RewriteRule ^.*$ /system/maintenance.html [L] |
This file contains 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
# Use local mail server | |
config.action_mailer.delivery_method = :sendmail |
OlderNewer