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
// jquery get mouse location | |
// clear post when lose focus | |
$("*", document.body).click(function (e) { | |
e.stopPropagation(); | |
var domEl = $(this).get(0); | |
if (!$(domEl).closest("#newsfeed_post").length > 0) { | |
$("#newsfeed_post textarea").css("color", "#aaa").val("Write something here..."); | |
} | |
}); |
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
brew install postgres | |
initdb /usr/local/var/postgres | |
psql postgres -c "create role postgres with login superuser" | |
psql postgres -c "alter user postgres with password 'password'" |
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
$.fn.setAllToMaxHeight = function(){ | |
return this.height( Math.max.apply(this, $.map( this , function(e){ return $(e).height() }) ) ); | |
} | |
// usage: $(‘div.unevenheights’).setAllToMaxHeight() | |
// http://www.broken-links.com/2009/01/20/very-quick-equal-height-columns-in-jquery/ |
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
jQuery.fn.supersleight = function(settings) { | |
settings = jQuery.extend({ | |
imgs: true, | |
backgrounds: true, | |
shim: 'x.gif', | |
apply_positioning: true | |
}, settings); | |
return this.each(function(){ | |
if (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) < 7 && parseInt(jQuery.browser.version, 10) > 4) { |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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
#!/bin/sh | |
for png in `find $1 -name "*.png"`; | |
do | |
echo "crushing $png" | |
pngcrush -brute "$png" temp.png | |
mv -f temp.png $png | |
done; |
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
{ | |
"Version":"2008-10-17", | |
"Id":"preventHotLinking", | |
"Statement":[ { | |
"Sid":"1", | |
"Effect":"Allow", | |
"Principal": { | |
"AWS":"*" |
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
script/generate extension_controller site | |
script/generate extension_migration site {migration} | |
script/generate extension_model site |
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
desc "Install log rotate script" | |
task :rotate_logs, :roles => :app do | |
set :use_sudo, true | |
default_run_options[:pty] = true | |
rotate_script = %Q{#{shared_path}/log/*.log { | |
daily | |
missingok | |
rotate 30 | |
compress | |
size 5M |
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
$.fn.ajaxForm_with_fancybox = function(options) { | |
$("<input>").attr("type", "hidden").attr("name", "lightbox").val("1").appendTo(this); | |
var url = jQuery(this).attr("action"); | |
this.ajaxForm({ | |
url: url + ".json", | |
beforeSend: function(request){ | |
$.fancybox.showLoading(); |