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
require 'net/http' | |
require 'net/https' | |
def get_feed(server,path,username,password) | |
http = Net::HTTP.new(server,443) | |
req = Net::HTTP::Get.new(path) | |
http.use_ssl = true | |
req.basic_auth username, password | |
response = http.request(req) | |
return response.body |
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 prompt_password | |
puts "Ask for Input: " | |
system "stty -echo" | |
from_user = $stdin.gets.chomp | |
system "stty echo" | |
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
# config/initializers/exception_notification.rb | |
ExceptionNotifier.exception_recipients = %w([email protected]) | |
ExceptionNotifier.sender_address = %("Application Error" <[email protected]>) | |
ExceptionNotifier.email_prefix = "[APPLICATION_NAME] " | |
# For older versions of Rails 2.x | |
ExceptionNotifier.class_eval do | |
remove_method :template_root | |
ExceptionNotifier.template_root = "#{RAILS_ROOT}/vendor/plugins/exception_notification/lib/../views" | |
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
# Capistrano Deploy Recipe for Git and Phusion Passenger | |
# | |
# After issuing cap deploy:setup. Place server specific config files in | |
# /home/#{user}/site/[staging|production]/shared | |
# Set :config_files variable to specify config files that should be | |
# copied to config/ directory (i.e. database.yml) | |
# | |
# To deploy to staging server: | |
# => cap deploy | |
# => Deploys application to /home/#{user}/site/staging from master branch |
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
<style> | |
ul.category_selection { | |
margin: 10px; | |
} | |
ul.category_selection li { | |
padding: 5px; | |
border: 1px solid #ccc; | |
margin: 5px 16px 5px 0; | |
display: block; |
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
#!/bin/bash | |
# /home/username/bin/backup_db.sh | |
# MySQL Backup | |
DATE=`date "+%y%m%d"` | |
BACKUP_DEST="/home/username/site/production/current/db" | |
DB="database_name" | |
DB_USER="db_user" | |
DB_USER_PW="db_password" |
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
// Requires Prototype.js | |
ConfirmedEmailValidator = Class.create( | |
{ | |
initialize: function(email_input, confirmation_input) { | |
this.valid_class = 'valid' | |
this.invalid_class = 'invalid' | |
this.email_id = email_input | |
this.confirmation_id = confirmation_input | |
this.re = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/ | |
this.add_observers() |
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
#!/bin/bash | |
# Lists listening processes. For OSX | |
sudo lsof -i -P | grep -i "listen" |
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
#Example Class | |
class ProfileWizardController < WizardController | |
define_steps :profile, :review_profile, :company, :review_company | |
set_default_error "There was a problem processing the last step!" | |
before_filter :login_required | |
skip_before_filter :store_location | |
def company | |
user_company |
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
¯\_(ツ)_/¯ | |
┌( ಠ_ಠ)┘ | |
{ಠಠ}_,,|, | |
ಥ_ಥ | |
(///_ಥ) | |
๏̯͡๏ | |
טּ_טּ | |
◪_◪ | |
◮_◮ | |
◔_◔ |
OlderNewer