Skip to content

Instantly share code, notes, and snippets.

{
"id": "/ctrlpkw",
"groups": [
{
"id": "/ctrlpkw/db",
"apps": [
{
"id": "/ctrlpkw/db/cassandra-seed",
"constraints": [["hostname", "UNIQUE"]],
"ports": [7199, 7000, 7001, 9160, 9042],
@takei-shg
takei-shg / FutureWithOptionT
Created March 5, 2015 15:28
com.twitter.util.Future Chain with OptionT
import scalaz._
import Scalaz._
import scalaz.OptionT._
import com.twitter.util.Future
/**
* Simple example of Future chain, which only shows type level consistency.
* Future chain can be implemented with optionT or simple flatMap chain.
*/
object Main extends App {
@ashrithr
ashrithr / FIleSystemOperations.java
Created February 26, 2015 01:27
HDFS FileSystems API example
package com.cloudwick.mapreduce.FileSystemAPI;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@jpillora
jpillora / INSTALL.md
Last active February 13, 2025 01:44
Headless Transmission on Mac OS X
  1. Go to https://developer.apple.com/downloads/index.action and search for "Command line tools" and choose the one for your Mac OSX

  2. Go to http://brew.sh/ and enter the one-liner into the Terminal, you now have brew installed (a better Mac ports)

  3. Install transmission-daemon with

    brew install transmission
    
  4. Copy the startup config for launchctl with

    ln -sfv /usr/local/opt/transmission/*.plist ~/Library/LaunchAgents
    
@miguno
miguno / CMSHashingBenchmark.scala
Created January 7, 2015 15:57
Benchmark for hashing implementations for CMS[BigInt] in Algebird
package com.twitter.algebird.caliper
import com.google.caliper.{ Param, SimpleBenchmark }
import com.google.common.hash.{ HashFunction, Hashing }
/**
* Benchmarks the hashing algorithms used by Count-Min sketch for CMS[BigInt].
*
* The input values are generated ahead of time to ensure that each trial uses the same input (and that the RNG is not
* influencing the runtime of the trials).
@travisbrown
travisbrown / SimpleHttpServer.java
Last active March 2, 2017 02:49
A very simple Finagle HTTP server example (no error handling, etc.)
import com.twitter.finagle.Http;
import com.twitter.finagle.ListeningServer;
import com.twitter.finagle.Service;
import com.twitter.finagle.http.HttpMuxer;
import com.twitter.util.Await;
import com.twitter.util.Future;
import java.net.InetSocketAddress;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.jboss.netty.buffer.ChannelBuffers.copiedBuffer;
import org.jboss.netty.handler.codec.http.*;
@ezhulenev
ezhulenev / deeptreemap.scala
Created December 4, 2014 22:43
Deep TreeMap conversion
import scala.collection.immutable.TreeMap
trait ToTreeMap[A] {
type Result
def treeMap(x: A): Result
}
trait LowerPriorityToTreeMap {
implicit def plainMap[K, V](implicit ord: Ordering[K]): ToTreeMap[Map[K, V]] =
anonymous
anonymous / mesosphere.sh
Created November 10, 2014 07:56
#! /bin/bash
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv E56151BF
DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
CODENAME=$(lsb_release -cs)
echo "deb http://repos.mesosphere.io/${DISTRO} ${CODENAME} main" | sudo tee /etc/apt/sources.list.d/mesosphere.list
sudo apt-get -y update --fix-missing
sudo apt-get -y install mesosphere
@acolyer
acolyer / service-checklist.md
Last active September 24, 2025 07:57
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@debasishg
debasishg / gist:b4df1648d3f1776abdff
Last active June 20, 2025 13:59
another attempt to organize my ML readings ..
  1. Feature Learning
  1. Deep Learning