Skip to content

Instantly share code, notes, and snippets.

@mirakui
mirakui / README.md
Last active December 20, 2015 11:08
fake-s3 + aws-sdk
$ gem install aws-sdk fake-s3
$ fakes3 -r /tmp/fakes3 -p 4567
Loading FakeS3 with /tmp/fakes3 on port 4567 with hostname s3.amazonaws.com
[2013-07-31 17:52:34] INFO  WEBrick 1.3.1
[2013-07-31 17:52:34] INFO  ruby 2.0.0 (2013-06-27) [x86_64-darwin12.4.0]
[2013-07-31 17:52:34] INFO  WEBrick::HTTPServer#start: pid=34539 port=4567
@mrflip
mrflip / tuning_storm_trident.asciidoc
Last active October 8, 2024 15:18
Notes on Storm+Trident tuning

Tuning Storm+Trident

Tuning a dataflow system is easy:

The First Rule of Dataflow Tuning:
* Ensure each stage is always ready to accept records, and
* Deliver each processed record promptly to its destination
@gkossakowski
gkossakowski / MemoryProbe.java
Created June 3, 2013 20:56
YourKit probe class that allows one to capture memory snapshots after certain phases has run in the Scala compiler.
import com.yourkit.probes.*;
import com.yourkit.api.*;
@MethodPattern("scala.tools.nsc.Global$Run:advancePhase()")
public class MemoryProbe {
public static void onEnter(@This scala.tools.nsc.Global.Run run) {
scala.reflect.internal.Phase patmatPhase = run.phaseNamed("patmat");
scala.reflect.internal.Phase postErasurePhase = run.phaseNamed("posterasure");
scala.reflect.internal.Phase icodePhase = run.phaseNamed("icode");
@justincampbell
justincampbell / after.sh
Created March 1, 2013 17:45
Jenkins + GitHub Commit Status API
if [[ $BUILD_STATUS == "success" ]]
then
export STATUS="success"
else
export STATUS="failure"
fi
curl "https://api.github.com/repos/justincampbell/my_repo/statuses/$GIT_COMMIT?access_token=abc123" \
-H "Content-Type: application/json" \
-X POST \
import java.util.Properties
import kafka.server.KafkaServer
import kafka.server.KafkaConfig
import kafka.producer.ProducerConfig
import kafka.producer.Producer
import kafka.message.Message
import kafka.producer.ProducerData
import kafka.consumer.ConsumerConfig
import kafka.consumer.Consumer
import kafka.utils.Utils
@taviso
taviso / ScaleWindow.c
Last active May 9, 2016 12:51
Apparently win32k is not Chuck Norris.
#ifndef WIN32_NO_STATUS
# define WIN32_NO_STATUS
#endif
#include <windows.h>
#include <assert.h>
#include <stdio.h>
#include <winerror.h>
#include <stddef.h>
#include <winnt.h>
#include <limits.h>
@patriknw
patriknw / PeekMailbox.scala
Created November 21, 2012 14:20
PeekMailbox example
package example
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.ConcurrentLinkedQueue
import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory
import akka.actor.Actor
import akka.actor.ActorContext
import akka.actor.ActorRef
import akka.actor.ActorSystem
@millisami
millisami / gist:3798773
Created September 28, 2012 09:04 — forked from juanje/gist:3797297
Mount apt cache of a Vagrant box in the host to spin up the packages installation

This is a little trick I use to spin up the packages instalation on Debian/Ubuntu boxes in Vagrant.

I add a simple function that checks if a directory named something similar to ~/.vagrant.d/cache/apt/opscode-ubuntu-12.04/partial (it may have another path in Windows or MacOS) and create the directory if it doesn't already exist.

def local_cache(box_name)
  cache_dir = File.join(File.expand_path(Vagrant::Environment::DEFAULT_HOME),
                        'cache',
                        'apt',
                        box_name)
@retronym
retronym / scala-hash.sh
Created September 17, 2012 21:54
scala-hash
#! /bin/bash
set -e
SCALA_DEV=~/code/scala
HASH=`git --git-dir $SCALA_DEV/.git rev-list "$1" | head -n1`
DESC=`git --git-dir $SCALA_DEV/.git describe $HASH`
shift
DIR=~/usr/scala-$DESC
SCALA=$DIR/pack/bin/scala
@bjornharrtell
bjornharrtell / proguard.cfg
Created August 9, 2012 20:58
Proguard config for akka including akka remote (tested with akka 2.0.2)
-dontwarn org.jboss.netty.logging.**
-dontwarn org.osgi.**
-dontwarn javax.servlet.**
-dontwarn org.jboss.netty.channel.socket.http.**
## Unsafe is there at runtime
-dontwarn sun.misc.Unsafe
-keep class sun.misc.Unsafe{
*;
}