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
Export your shell environment for http proxy use | |
export http_proxy="http://hostname:port" or save it to your shell profile. (i.e. ~/.bash_rc) | |
export http_proxy='http://example.proxy_name.com:80' | |
For multi-user installs, use sudo -E to preserve the proxy settings in your environment: | |
Setting git to use a proxy | |
git config --global url.https://github.com/.insteadOf git://github.com/ | |
git config --global http.proxy %http_proxy% |
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
require "dim" | |
AppContainer = Dim::Container.new | |
AppContainer.register(:env) { ENV['ADWORK_ENV'] || "development" } | |
AppContainer.register(:production?) { |c| c.env == 'production' } | |
AppContainer.register(:development?) { |c| c.env == 'development' } | |
AppContainer.register(:test?) { |c| c.env == 'test' } | |
AppContainer.register(:root) { File.expand_path(File.dirname(__FILE__)+"/../..") } | |
AppContainer.register(:logger) do |c| |
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
function die() | |
{ | |
echo "${@}" | |
exit 1 | |
} | |
# Add <strong>.old</strong> to any existing Vim file in the home directory | |
for i in $HOME/.vim $HOME/.vimrc $HOME/.gvimrc; do | |
if [[ ( -e $i ) || ( -h $i ) ]]; then | |
echo "${i} has been renamed to ${i}.old" |
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
# /etc/nginx/cloudflare.conf | |
# If using Cloudflare, uncomment the following to get proper originating IPs | |
#set_real_ip_from 204.93.240.0/24; | |
#set_real_ip_from 204.93.177.0/24; | |
#set_real_ip_from 199.27.128.0/21; | |
#set_real_ip_from 173.245.48.0/20; | |
#set_real_ip_from 103.22.200.0/22; | |
#set_real_ip_from 141.101.64.0/18; | |
#real_ip_header CF-Connecting-IP; |
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
package backchat | |
package web | |
import javax.servlet.http.{ HttpServletResponse, HttpServletRequest } | |
import org.scalatra._ | |
import collection.JavaConversions._ | |
object CORSSupport { | |
val ORIGIN_HEADER: String = "Origin" | |
val ACCESS_CONTROL_REQUEST_METHOD_HEADER: String = "Access-Control-Request-Method" |
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
# Add this to your spec_helper.rb | |
RSpec.configure do |config| | |
config.treat_symbols_as_metadata_keys_with_true_values = true | |
config.around(:each, :vcr) do |example| | |
name = example.metadata[:full_description].downcase.gsub(/\W+/, "_").split("_", 2).join("/") | |
VCR.use_cassette(name, :record => :new_episodes) do | |
example.call | |
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
import sbt._ | |
import Keys._ | |
import org.sbtidea._ | |
import SbtIdeaPlugin._ | |
import Scope.{GlobalScope, ThisScope} | |
object BuildSettings { | |
val buildOrganization = "com.mojolly.backchat" | |
val buildScalaVersion = "2.9.0-1" | |
val buildVersion = "0.8.1-SNAPSHOT" |
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
export RUBYOPT="rubygems" | |
rvm_install_on_use_flag=1 | |
if [ -z $(rvm gemset list | grep virtmachines) 2> /dev/null ]; then | |
rvm ruby-1.8.7 | |
rvm gemset create virtmachines | |
fi | |
rvm ruby-1.8.7@virtmachines |
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
package com.mojolly.backchat | |
package web | |
import org.scalatra.ScalatraServlet | |
import akka.actor.{Scheduler, Actor} | |
import javax.servlet.http.{HttpServletResponse, HttpServletRequest} | |
import org.atmosphere.cpr.BroadcastFilter.BroadcastAction | |
import org.atmosphere.cpr._ | |
import org.atmosphere.util.XSSHtmlFilter | |
import collection.JavaConversions._ |
NewerOlder