$ uname -r
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
Backup::Model.new(:appbackup, 'appbackup') do | |
store_with Local do |local| | |
local.path = '/backups/' | |
# Use a number or a Time object to specify how many backups to keep. | |
local.keep = 14 | |
end | |
compress_with Bzip2 | |
database PostgreSQL do |db| |
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
# Use this file to easily define all of your cron jobs. | |
# # | |
# # It's helpful, but not entirely necessary to understand cron before proceeding. | |
# # http://en.wikipedia.org/wiki/Cron | |
# | |
# # Example: | |
# # | |
# # set :output, "/path/to/my/cron_log.log" | |
# # | |
# # every 2.hours do |
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/bash | |
mkdir -p /opt/bin | |
curl -L `curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r '.assets[].browser_download_url | select(contains("Linux") and contains("x86_64"))'` > /opt/bin/docker-compose | |
chmod +x /opt/bin/docker-compose |
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 | |
PROXY_USER=user | |
PROXY_PASS=password | |
PROXY_PORT=3128 | |
# Clear the repository index caches | |
yum clean all | |
# Update the operating system |
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
# Textmate essential bundles | |
cd ~/Library/Application\ Support/TextMate/Pristine\ Copy/Bundles | |
# mkdir -p cd /Applications/TextMate.app/Contents/SharedSupport/Bundles | |
git clone git://github.com/protocool/ack-tmbundle.git Ack.tmbundle | |
git clone git://github.com/textmate/ruby-haml.tmbundle.git | |
git clone git://github.com/seaofclouds/sass-textmate-bundle.git "Ruby Saas.tmbundle" | |
git clone https://github.com/aslakhellesoy/cucumber-tmbundle.git Cucumber.tmbundle | |
git clone git://github.com/karnowski/blue-ridge-tmbundle.git JavaScript\ Blue\ Ridge.tmbundle | |
git clone git://github.com/johnmuhl/nginx-tmbundle.git nginx.tmbundle |
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/bash | |
#encrypt files with aes-256-cbc cipher using openssl | |
#install: | |
# sudo wget -O /usr/bin/enc https://gist.github.com/krisf/5391210/raw/4a105a6b8f98f39e9e74a1dd2a78ef6f631acdb1/enc | |
# sudo chmod +x /usr/bin/enc | |
# enc --help | |
#encrypt files | |
if [ $1 == "-e" ]; | |
then |
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
#Theirs: | |
class UsersController < ApplicationController | |
def follow | |
@user = User.find(params[:id]) | |
if current_user.follow(@user) | |
redirect_to root_url | |
else | |
redirect_to @user | |
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
user = Factory(:user, :role => "admin") | |
visit new_user_session_path | |
fill_in "user_email", :with => user.email | |
fill_in "user_password", :with => "foobar" | |
click_button "Sign" |
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 ProfilesController < AuthorizedController | |
before_filter :extract_location, :only => :search | |
def search | |
search_terms = params[:profile].keep_if {|key, val| !val.blank? && val != '0'} | |
search_terms.each{|key, val| search_terms[key] = true if val == '1'} | |
if @location_params[:name] | |
@locations = Location.near(@location_params[:name], @location_params[:within], {:select => "locations.*, profiles.*", :units => :km}).joins(:profile).has_user_role.where(:profiles => search_terms) | |
current_hometown_filter_for_search(@locations) | |
profile_ids = @locations.map{|loc| loc.profile_id}.compact.uniq |
NewerOlder