Skip to content

Instantly share code, notes, and snippets.

View clifton's full-sized avatar
🎯

Clifton King clifton

🎯
View GitHub Profile
diff --git a/config/environments/production.rb b/config/environments/production.rb
index f6124a6..7daf949 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -31,5 +31,10 @@ config.after_initialize do
end
$PAYPAL_LOGIN = $PAYPAL_CONFIG[Rails.env]["api_username"]
$PAYPAL_PASSWORD = $PAYPAL_CONFIG[Rails.env]["api_password"]
-config.cache_store = ActiveSupport::Cache::MemCacheStore.new(Memcached::Rails.new("10.211.47.148:11211", :namespace => "wb_data:"))
-ActionController::Base.cache_store = :mem_cache_store, Memcached::Rails.new("10.211.47.148:11211", :namespace => "wb_data:")
class ActiveRecord::ConnectionAdapters::MysqlAdapter
def active?
true
end
def execute_with_retry_if_fail(*args)
execute_without_retry_if_fail(*args)
rescue ActiveRecord::StatementInvalid => e
if e.message =~ /server has gone away/i
warn "Server timed out, retrying"
https://gist.github.com/946747
# join model
class Membership < ActiveRecord::Base
include PortalEntity
include Notifiable
cattr_accessor :skip_create_feed
@@skip_create_feed = false
# virtual attribute for verification purposes
attr_accessor :password
// requires Store.js
OrgSync.cache = (function(store) {
if (!store || typeof store.get !== 'function' || typeof store.set !== 'function') {
throw new Error("Store API not defined.");
}
var api = {};
var now = function () {
return parseInt((new Date).getTime() / 1000);
res = Faraday.get("http://weather.yahooapis.com/forecastrss?w=#{woe_id}")
xml = Nokogiri::XML(res.body)
loc_xml = xml.css('yweather|location')
weather_xml = xml.css('yweather|condition')
@weather_data = {
:city => loc_xml.attr('city').text,
:state => loc_xml.attr('region').text,
:country => loc_xml.attr('country').text,
commit b517816e0944df9d4e6885471b1fc4671355bfe4
Author: Clifton King <cliftonk@gmail.com>
Date: Thu Jun 16 10:39:52 2011 -0500
fixed creating a community
diff --git a/app/models/shareable.rb b/app/models/shareable.rb
index 6512439..dc3038c 100644
--- a/app/models/shareable.rb
+++ b/app/models/shareable.rb
fs = require 'fs'
http = require 'http'
{EventEmitter} = require 'events'
path = require 'path'
colors = require 'colors'
hostsDir = path.join __dirname, '../hosts'
class HostList extends EventEmitter
constructor: (@group) ->
[self, @servers, @queue] = [this, {}, []]
fe1 localhost:3000
fe2 127.0.0.1:3000
fe3 0.0.0.0:3000
fe1 localhost:3000
fe2 127.0.0.1:3000
fe3 0.0.0.0:3000