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
class BaseCollection extends Backbone.Collection | |
_expiresAfter: 15 # seconds | |
_lastFetched: null | |
isStale: -> | |
now = (new Date()).getTime() | |
!@_lastFetched? || now - @_lastFetched > (@_expiresAfter * 1000) | |
refresh: (models, options) -> |
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
# install @sishen's ruby gem for access to Google's translate API access: | |
# https://github.com/sishen/rtranslate | |
$ gem install sishen-rtranslate | |
# add alias for quick access and reload: | |
# (adjust/add languages as needed) | |
$ echo "alias fin='rtranslate -f en -t fi'" >> .profile | |
$ source .profile | |
# try it: |
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 'net/http' | |
require 'json' | |
# For the lazy like me who find themselves | |
# frequently adding lines like | |
# TODO: add documentation | |
# | |
# Find all these lines in the current project | |
# and create Github issues accordingly | |
# The issue will contain a link to the current branch |
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.easing['jswing'] = jQuery.easing['swing']; | |
jQuery.extend(jQuery.easing, { | |
eightyTwentyLinear: function(x, t, b, c, d) { | |
return ((b + c) - (b + c) * 0.8) * (t /= d) + (b + c) * 0.8; | |
}, | |
eightyTwentyQuartOut: function(x, t, b, c, d) { | |
return -((b + c) - (b + c) * 0.8) * (t /= d) * (t - 2) + (b + c) * 0.8; | |
} | |
}); |
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 "Compile assets, commit them and deploy to heroku" | |
task :deploy do | |
puts legend("Precompiling assets") | |
%x(rake assets:precompile RAILS_ENV=production) | |
puts legend("Committing assets") | |
%x(git add public/assets/*) | |
%x(git commit -m "Precompiled assets for production.") |
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.bounce = function(options) { | |
var settings = $.extend({ | |
speed: 10 | |
}, options); | |
return $(this).each(function() { | |
var $this = $(this), | |
$parent = $this.parent(), |
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
#page-container, .global-nav .container { | |
width: 550px; | |
} | |
div[data-component-term="user_recommendations"], div[data-component-term="trends"], div[data-component-term="footer"], .larry-topbar { | |
display: none; | |
} | |
#page-node-home .dashboard, #page-node-home .content-main { | |
float: none; |
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
# I came across this snippet http://gistflow.com/posts/422-highlight-code-for-keynote-presentation | |
# but it didn’t work until @pietia was so nice to point out that there’s no need for the output file. | |
# 1. Install highlight | |
brew install highlight | |
# 2. Add this to e.g. .bash_profile and reload it | |
function hl() { | |
format=${1-rb}; | |
pbpaste | highlight --syntax=$format -O rtf | pbcopy; |
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
Fixing bug with message to self. | |
The actual resetting page. | |
Reloadin'. | |
some trick for worker | |
tricks p2 | |
Fleshy pipi animation. | |
Things I don't remember I did. | |
turned off the debugger | |
let's try to fix order | |
Things. |
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
############################## | |
############################## | |
# > this is a name, right? no need to translate? | |
robot_in_the_cloak: "Robot in the Cloak" | |
site_title: "#iOSonRailsConf 2013" | |
site_description: "Eine Konferenz für Ruby on Rails und iOS-Entwickler aus aller Welt, die im Frühjahr 2013 in Aluschta stattfinden wird." | |
site_description_short: "Ruby on Rails und iOS-Entwickler Konferenz." | |
site_keywords: "Ruby, Rails, ios, Entwickler, Konferenz, 2013, Web, Handy, iphone, ipad, ipod" |
OlderNewer