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
<FilesMatch "\\.(js|css|html|htm|php|xml)$"> | |
SetOutputFilter DEFLATE | |
</FilesMatch> |
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
$(document).ready(function(){ | |
$('.js_resize').each(function(){ | |
var imageParent = $(this).parent(); | |
var myWidth = $(this).width(); | |
var myHeight = $(this).height(); | |
var parentWidth = $(this).parent().width(); | |
var parentHeight = $(this).parent().height(); | |
var offset, ratio, newSide; | |
if (myWidth>myHeight) { | |
if ($(this).height()>parentHeight) { |
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
<FilesMatch "\\.(js|css|html|htm|php|xml)$"> | |
SetOutputFilter DEFLATE | |
</FilesMatch> | |
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"> | |
Header set Expires "Thu, 15 Apr 2011 20:00:00 GMT" | |
Header unset ETag | |
FileETag None | |
</FilesMatch> | |
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
place = DbObjectCache::fetch("pd-#{params[:permalink]}", 3.days) do | |
thrift_safe do | |
Loopt::PlacesClient.new.getPlaceByPermalink(Type::Request.new, params[:permalink]) | |
end | |
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
jQuery.fn.clearThis = function() { | |
return this.each(function(){ | |
var initVal = $(this).val(); | |
$(this).click(function(){ | |
if ($(this).val()==initVal) { | |
$(this).val(''); | |
} | |
}); | |
$(this).blur(function(){ | |
if ($(this).val()=='') { |
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
def execution_time | |
start = Time.now | |
yield | |
puts Time.now - start # Here you would probably log the elapsed time | |
end | |
execution_time do | |
1.upto(10000) do |i| | |
i * 1 # LIke a for loop | |
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
<div class="users"> | |
<% users.in_groups_of(10, false) do |user_group| %> | |
<div class="user-row"> | |
<% for user in user_group %> | |
your user here | |
<% end %> | |
</div> | |
<% end %> | |
</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
$flap_left = 1 | |
$flap_right = 2 | |
.ribbon-wrapper | |
position: relative | |
background-color: $etsy | |
padding: 10px 30px 10px 55px | |
margin-bottom: 10px | |
border: 1px solid #ddd | |
=ribbon($color, $flap, $flaps=1, $direction=$flap_left) |
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
RED="\[\033[1;31m\]" | |
YELLOW="\[\033[1;33m\]" | |
GREEN="\[\033[1;32m\]" | |
WHITE="\[\033[1;37m\]" | |
BLUE="\[\033[1;36m\]" | |
# Returns "*" if the current git branch is dirty. | |
function parse_git_dirty { | |
[[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]] && echo "*" |
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
// obviously this is for alpha | |
myArray.sort(function(x, y){ | |
var xl = x.toLowerCase(); | |
var yl = y.toLowerCase(); | |
if (xl<yl) return -1; | |
if (xl>yl) return 1; | |
return 0; | |
}); |
OlderNewer