Skip to content

Instantly share code, notes, and snippets.

View pjkelly's full-sized avatar

PJ Kelly pjkelly

  • Orange County, CA
View GitHub Profile
@pjkelly
pjkelly / unicorn.rb
Last active April 19, 2017 09:27 — forked from pablitoc/unicorn.rb
require 'dotenv'
Dotenv.load
listen ENV.fetch('UNICORN_PORT', 5000), :backlog => ENV.fetch('UNICORN_BACKLOG', 200).to_i
worker_processes ENV.fetch('UNICORN_CONCURRENCY', 3).to_i
timeout ENV.fetch('UNICORN_TIMEOUT', 15).to_i
preload_app true
if ENV.include?('UNICORN_LOG')
stderr_path ENV.fetch('UNICORN_LOG')
@pjkelly
pjkelly / sublime-user-settings.json
Created June 7, 2014 04:11
Sublime User Settings
{
"color_scheme": "Packages/Color Scheme - Default/Sunburst.tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": false,
"folder_exclude_patterns":
[
"log",
"tmp",
"backups",
"dump",
// Load environment variables
require('dotenv');
// Cluster Initialization
var cluster = require('cluster');
// Code to run if we're in the master process
if (cluster.isMaster) {

Ron,

We've been doing some thinking about things that will help optimize the auction clock, especially at the end of auctions, and wanted to run some stuff by you. Because all client browsers and computers are different, we need a way to make sure that all clients are keeping the correct time based on the server. To achieve this, we have historically been sending down a message from the server to all clients with the current time on the server.

A few problems have occurred with this approach. One is that, since we moved you from a custom web sockets implementation to Pusher, you are now being charged based on the number of messages sent to the clients. This means that our messages to each connected client will add up very quickly, and we want to avoid that for you. The second problem is that the constant pusshing of information can be a drain on resources for the server, especially when it is unnecessary for the auction to be updating so frequently when the auction is weeks, days, even hours, away from exp

machine:
environment:
CODECLIMATE_REPO_TOKEN: mytoken
NODE_ENV: ci
node:
version: 0.10.26
dependencies:
pre:
- npm install -g codeclimate-test-reporter
test:
# mongoid 3.x
#
# As discussed in: http://blog.mongolab.com/2014/02/mongodb-driver-tips-tricks-mongoid-3
#
production:
sessions:
default:
# The standard MongoDB connection URI allows for easy replica set
# connection setup.
# Use environment variables or a config file to keep your
@pjkelly
pjkelly / connections.md
Last active August 29, 2015 13:57
The table below shows the number of connections per server supported by current browsers for HTTP/1.1 as well as HTTP/1.0.
2
Browser HTTP/1.1 HTTP/1.0
IE 6,7
@pjkelly
pjkelly / settings.json
Created December 18, 2013 16:37
Sublime Text 3 User Settings
{
"color_scheme": "Packages/Color Scheme - Default/Sunburst.tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": false,
"folder_exclude_patterns":
[
"log",
"tmp",
"backups",
"dump",
@pjkelly
pjkelly / latency.md
Last active December 29, 2015 10:59
Traceroutes on Level3 and Google primary DNS servers to demonstrate horrible latency.

Level3 Primary DNS Server

9:57AM PST

[~]$ traceroute 209.244.0.3
traceroute to 209.244.0.3 (209.244.0.3), 64 hops max, 52 byte packets
 1  192.168.1.1 (192.168.1.1)  2.784 ms  9.760 ms  0.813 ms
 2  cpe-75-85-84-1.socal.res.rr.com (75.85.84.1)  44.614 ms  30.433 ms  29.802 ms
 3  tge7-1.lkercaag01h.socal.rr.com (76.166.2.81)  16.298 ms  8.776 ms  9.288 ms
@pjkelly
pjkelly / 1-terminal.log
Created October 24, 2013 23:43
Boxen/Librarian Puppet Issues
$ librarian-puppet install --verbose
[Librarian] Ruby Version: 1.9.3
[Librarian] Ruby Platform: x86_64-darwin12.4.0
[Librarian] Rubygems Version: 1.8.23
[Librarian] Librarian Version: 0.0.24
[Librarian] Librarian Adapter: puppet
[Librarian] Project: /opt/boxen/repo
[Librarian] Specfile: Puppetfile
[Librarian] Lockfile: Puppetfile.lock
[Librarian] Git: /opt/boxen/homebrew/bin/git