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
Model.connection.clear_query_cache |
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
// | |
// Configurationl | |
// | |
LightboxOptions = Object.extend({ | |
fileLoadingImage: 'images/loading.gif', | |
fileBottomNavCloseImage: 'images/closelabel.gif', | |
overlayOpacity: 0.8, // controls transparency of shadow overlay | |
animate: true, // toggles resizing animations |
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
$ gem install high_voltage |
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
module ApplicationHelper | |
def google_analytics_js | |
content_tag(:script, :type => 'text/javascript') do | |
"var _gaq || []; | |
_gaq.push(['_setAccount', 'XX-XXXXXXXX-X']); | |
_gaq.push(['_trackPageview']); | |
(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
$ git config --global alias.br branch | |
$ git config --global alias.co checkout | |
$ git config --global alias.ci commit | |
$ git config --global alias.pom 'push origin master' |
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
def calc_exp_date | |
expirationdate.wday == 6 ? self.expirationdate = expirationdate+(21) : self.expirationdate = expirationdate+(14 + 6 - expirationdate.wday) | |
end |
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
# times are based on 25,000 iterations | |
# solution 1 / time: 1.47936483s | |
def capitalize(time) | |
string.split.each{|n| n.capitalize!}.join ' ' | |
end | |
# solution 2 / time: 2.32211853s | |
def capitalize(string) |
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
git ls-files --deleted | xargs git rm | |
ps | |
lsof -i tcp:3000 | |
kill -int {pid} | |
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
Feature: Creating Repositories | |
In order to have repositories to solicit help on | |
As a user | |
I want to add my repositories | |
Background: | |
Given I am on the homepage | |
When I follow "New Repository" | |
Scenario: Creating a repository |
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
sentence = "rake routes --help this last part" | |
def with_split sentence | |
a = sentence.split('--') | |
@build_args = "--" << a[1] | |
@args = a[0] | |
end | |
def with_slice sentence | |
dash_ind = sentence.index("--") |
OlderNewer