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 | |
## Run a project's test prior to pushing to a remote, and prevent the push if tests fail. | |
RUBY_TESTS=() | |
if [ -d "test" ]; then | |
RUBY_TESTS+=('ruby -Itest') | |
fi |
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
<?php | |
/** | |
* Dirty, dirty Reddit bot: Decronym | |
*/ | |
class Reddit { | |
const USERNAME = '***'; | |
const PASSWORD = '***'; | |
const CLIENTID = '***'; | |
const SECRET = '***'; |
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
$ cap production whenever:clear_crontab | |
$ cap production whenever:update_crontab |
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
# deploy.rb | |
server '0.0.0.0', roles: %w{ retire } # Old app server is given a role of 'retire' | |
server '0.0.0.1', roles: %w{ app db } # New app server gets the existing roles | |
set :whenever_roles, %w{ retire app } |
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
<table> | |
<thead> | |
<th>Foo</th> | |
<% if feature_enabled?(:premium) %> | |
<th>Premium</th> | |
<% end %> | |
</thead> | |
<tbody> | |
<tr> | |
<td><%= @widget.foo %></td> |
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
# ./functions/_tmux-new-session | |
#compdef tmux-new-session | |
compadd $(tmux list-sessions -F \#S | sed "s/[\* ]//g") |
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 | |
### BEGIN INIT INFO | |
# Provides: solr | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Solr indexing service | |
# Description: Solr is an open source enterprise search platform. | |
### END INIT INFO |
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 Foo | |
def dangerous | |
# Do stuff before the block | |
begin | |
raise 'Danger!' | |
rescue | |
# Make it safe | |
end | |
end | |
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
describe 'some/view/file' do | |
before do | |
controller.singleton_class.class_eval do | |
def feature_enabled?(feature_name) | |
false | |
end | |
helper_method :feature_enabled? | |
end | |
end |