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
# Ignore any SSL certificate errors | |
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} | |
(New-Object System.Net.WebClient).DownloadFile("http://example.com/myfile.txt", "C:\myfile.txt") |
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
# lib/core_ext/active_record_extensions.rb | |
module ActiveRecordExtensions | |
extend ActiveSupport::Concern | |
def clean_strings! | |
self.attributes.select{|key, val| val.class == String}.each {|key, val| val.strip!} | |
end | |
included do |
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 | |
# chkconfig: 2345 90 10 | |
# description: init.d script for starting a Rails app running Unicorn. | |
set -e | |
USER=rails_deployer | |
APP_NAME=rails_test | |
APP_ROOT=/var/www/$APP_NAME |
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 'ffi' | |
class Fixnum | |
def hex(numchars=16) | |
self.to_s(numchars).upcase | |
end | |
end | |
module FFI | |
class Struct |
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
<VirtualHost *:80> | |
ServerName localhost | |
# ServerAlias www.localhost.com | |
DocumentRoot /var/www/myrailsapp/current/public | |
RewriteEngine On | |
# Redirect all non-static requests to unicorn | |
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f |
NewerOlder