start new:
tmux
start new with session name:
tmux new -s myname
# https://www.varnish-cache.org/docs/2.1/tutorial/vcl.html | |
# https://www.varnish-cache.org/trac/wiki/VCLExamples | |
# Summary | |
# 1. Varnish will poll the backend at /health_check to make sure it is | |
# healthy. If the backend goes down, varnish will server stale content | |
# from the cache for up to 1 hour. | |
# 2. Varnish will pass X-Forwarded-For headers through to the backend | |
# 3. Varnish will remove cookies from urls that match static content file | |
# extensions (jpg, gif, ...) |
namespace :deploy do | |
desc "Hot-reload God configuration for the Resque worker" | |
task :reload_god_config do | |
sudo "god stop resque" | |
sudo "god load #{File.join(deploy_to, 'current', 'config', 'resque-' + rails_env + '.god')}" | |
sudo "god start resque" | |
end | |
end | |
# append to the bottom: |
source 'http://rubygems.org' | |
gem "hiredis", "~> 0.3.1" | |
gem "em-synchrony" | |
gem 'em-hiredis' | |
#gem "redis", "~> 2.2.0", :require => ["redis/connection/synchrony", "redis"] | |
gem "goliath" | |
#gem 'em-synchrony', :git => 'git://github.com/igrigorik/em-synchrony.git' |
# coding: utf-8 | |
require 'sinatra' | |
set server: 'thin', connections: [] | |
get '/' do | |
halt erb(:login) unless params[:user] | |
erb :chat, locals: { user: params[:user].gsub(/\W/, '') } | |
end | |
get '/stream', provides: 'text/event-stream' do |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Leaflet</title> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" /> | |
<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script> | |
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script> | |
<script src="http://matchingnotes.com/javascripts/leaflet-google.js"></script> | |
</head> | |
<body> |
var fs = require('fs'); | |
//this is the path that QTNetwork classes uses for caching files for it's http client | |
//the path should be the one that has 16 folders labeled 0,1,2,3,...,F | |
exports.cachePath = '/path/to/phantomjs/cache/data/folder'; | |
//this is the extension used for files in the cache path | |
exports.cacheExtension = "d"; | |
//the resources that are to be saved |
$(document).on "page:change", -> | |
window.prevPageYOffset = window.pageYOffset | |
window.prevPageXOffset = window.pageXOffset | |
$(document).on "page:load", -> | |
if $(".fix-scroll").length > 0 | |
$('.fix-scroll').hide().show() # force re-render -- having an issue with that on Chrome/OSX | |
window.scrollTo window.prevPageXOffset, window.prevPageYOffset |
upstream backends { | |
ip_hash; | |
server 0.0.0.0:80; | |
server 0.0.0.0:80; | |
} | |
server { | |
server_name app.falconsocial.com; |
require 'stringio' | |
class RedisSubscribe < EM::Connection | |
def self.connect(host, port, pass = '') | |
Rails.logger.debug host | |
Rails.logger.debug port | |
client = EM.connect host, port, self | |
client.auth pass if pass.present? |