Skip to content

Instantly share code, notes, and snippets.

View ralph-tice's full-sized avatar

Ralph Tice ralph-tice

  • Kentik
  • Texas
View GitHub Profile
jar 'com.netflix.hystrix:hystrix-core', '~>1.2.16'
@fedesilva
fedesilva / In-2.10.x.scala
Last active December 18, 2015 05:29
I love this language.
implicit class In[T](t:T) {
def in(opts:T*): Boolean = opts contains t
}
scala> 1 in ( 2, 3 )
res1: Boolean = false
scala> 1 in ( 2, 3, 2, 1 )
res2: Boolean = true
@krishnanraman
krishnanraman / zipcodes of wealthy elite
Last active December 20, 2015 06:09
Where do the WEALTHY WELL EDUCATED ELITE live ?
/*
Goal: Use Scalding to datamine the 2010 US Census data (kindly provided by @ElonAzoulay & @hmason), to find
Where do the WEALTHY WELL EDUCATED ELITE live ?
WEALTHY == house value quarter million, household income 150k
WELL EDUCATED == sort by edu, edu = (10 * Phd + 5 * MS + 1 * BS) score
*/
import com.twitter.scalding._
import cascading.tuple.Fields
import cascading.tap.SinkMode
@aphyr
aphyr / gist:6266347
Last active December 21, 2015 06:48
In this ZK demo, a partition places the primary on the minority component. All
operations time out while the cluster converges on a new primary, at which
point three clients (talking to the three nodes in the majority component) can
proceed again. When the partition is healed, the two minority nodes can begin
accepting writes again. As with single-node Postgres, Zookeeper's client
protocol and ZAB both allow for false negatives (timeouts may actually succeed)
but not false positives (every successful write *will* be present in the final
set.)
HOW TO READ THIS CHART:
@miketheman
miketheman / plusfiles.rb
Created August 27, 2013 13:38
fragment for dealing with S3 and plus sign in URLs. Part of a bigger tool that will be open-sourced at some point.
# S3 translates a '+' in filenames to %2B in the URL, breaking apt
# Here we will traverse any file in the pool/ dir and create a hardlink for
# any file that has a plus in its name. apt/wget will do the right thing.
Dir.chdir('<%= @repo_root %>') do
plusfiles = Dir.glob '**/*/*+*.deb'
begin
plusfiles.each do |file|
File.link(file, file.gsub('+', ' '))
end
rescue SystemCallError # swallow this if file already exists
@al3xandru
al3xandru / gist:7283595
Last active December 27, 2015 06:39
Ricon West 2013 : Full day streams jump list
## Day 1 - Track 1 ##
00:10:00 Pat Helland: Keystone - Between a ROC and a SOFT place
01:12:18 Lindsey Kuper: LVars: Lattice-based Data Structures for Deterministic Parallelism
02:11:54 Eric Redmond: Yokozuna!
04:10:50 Justin Shoffstall & Charlie Voiselle: The Seven-Layer Burrito; Troubleshooting a Distributed Database in Production
05:11:00 Peter Bailis: Bad as I wanna be - Coordination and Consistency in Distributed Databases
06:13:24 Joseph Blomstedt: Bringing Consistency to Riak (Part 2)
07:16:22 Lightning talks (_nb_: you **must** see @tsantero!)

Reciprocal Needs in the Employment Relation

We can look at two sides of the management coin: What do the individuals get out of it? And what benefit does the whole system derive from it?

I will disregard any benefits that accrue to managers just by holding the position of managing. Those are just circular logic. Circular logic abounds in discussions of management and hierarchy. For example, consider status reports. It will be said that status reports are necessary so managers know what their employees are working on. It’s

@dctrwatson
dctrwatson / gist:7763943
Created December 3, 2013 04:37
RAID adapter blocking due to a dead drive causing issues with Cassandra and pycassa
[21174748.746874] INFO: task jsvc:9672 blocked for more than 120 seconds.
[21174748.749104] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[21174748.751489] jsvc D ffffffff81806240 0 9672 9639 0x00000000
[21174748.751497] ffff8803436abe08 0000000000000082 ffff8800850bd000 ffffffffffffff98
[21174748.751516] ffff8803436abfd8 ffff8803436abfd8 ffff8803436abfd8 00000000000137c0
[21174748.751534] ffff88032bf39700 ffff8805fe535c00 ffff880622cf40c0 ffff8805fe535c00
[21174748.751553] Call Trace:
[21174748.751563] [<ffffffff8165ba6f>] schedule+0x3f/0x60
[21174748.751573] [<ffffffff8165d86d>] rwsem_down_failed_common+0xcd/0x170
[21174748.751583] [<ffffffff8165d923>] rwsem_down_write_failed+0x13/0x20
@deserat
deserat / gist:8245275
Last active January 2, 2016 03:39
Node JS Benchmarks Amazon AWS vs Joyent

The script:

var http = require('http')
var fs = require('fs')


http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'})
  res.end("hello world")
}).listen(3000);
@bohde
bohde / graphite_pip_uwsgi_recipe.sh
Created November 28, 2011 18:08 — forked from bfritz/graphite_pip_uwsgi_recipe.sh
installing graphite-web with pip and running under uwsgi
# graphite-web install is hardcoded in setup.cfg to /opt/graphite
sudo mkdir /opt/graphite
sudo chown brad.users /opt/graphite
# run under python2.7 virtualenv
virtualenv --python=python2.7 ~/ve/graphite
source ~/ve/graphite/bin/activate
# install the necessary python packages (simplejson is for flot graphs)
pip install graphite-web carbon whisper django django-tagging uwsgi simplejson