Skip to content

Instantly share code, notes, and snippets.

View reoring's full-sized avatar
🏢
work at office

reoring reoring

🏢
work at office
View GitHub Profile
@momania
momania / gist:858476
Created March 7, 2011 13:05
Akka AMQP Loadbalance
import akka.amqp.AMQP._
import akka.amqp._
import akka.actor._
import java.util.concurrent.{TimeUnit, CountDownLatch}
import util.Random
object LoadBalancingDemo {
def main(args: Array[String]) {
@realbot
realbot / Example.scala
Created May 20, 2011 15:32
Retrying with style
val retryBlock = new Retry[String](6)
import retryBlock.retry
retry {
doSomething(somePar)
} giveup {
case e: Exception => handleException(e)
}
@vmihailenco
vmihailenco / proxy.go
Created November 20, 2011 15:22
Simple TCP proxy in Golang
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
@mostlygeek
mostlygeek / demo.rb
Created January 24, 2012 21:29
Chef ruby_block and dynamic resource creation
ruby_block "sync_build_from_s3" do
action :nothing
block do
# latest_file contains path to the latest.txt, which lists files to sync
file = File.new(latest_file, "r");
run_context = Chef::RunContext.new(node, {})
#
# Create the directory to hold the new build files
#

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@mergeconflict
mergeconflict / pimps.scala
Created March 13, 2012 01:55
typeclass fu
object Hoho {
trait Foo[A] {
def phooey(): Unit
}
implicit def intFoo(i: Int): Foo[Int] = new Foo[Int] {
def phooey(): Unit = println("int " + i.toString)
}
window.stoppingPropagation = (callback) -> (e) ->
e.stopPropagation()
callback(e)
angular.module('myApp',[]).directive 'ngTap', ->
(scope, element, attrs) ->
tapping = false
element.bind 'touchstart', stoppingPropagation (e) -> tapping = true
element.bind 'touchmove', stoppingPropagation (e) -> tapping = false
element.bind 'touchend', stoppingPropagation (e) -> scope.$apply(attrs['ngTap']) if tapping
@Gab-km
Gab-km / github-flow.ja.md
Last active April 25, 2024 04:01 — forked from juno/github-flow.ja.md
GitHub Flow (Japanese translation)
@sasaki-shigeo
sasaki-shigeo / gist:3727810
Created September 15, 2012 13:18
Conversion from/to Numeric Type in Scala (Scala における数値型の変換)
import math._
1L // Long型の 1
1:Long // Long型の 1
127:Byte // Byte型の 127
32767:Short // Short型の 32767
(1+2).toLong // Long型への変換
(2+3) toLong // Long型への変換
@callado4
callado4 / behat-phantomjs-webdriver.md
Last active January 24, 2021 17:10
Instructions on how to make behat (with mink) use the phantomjs webdriver to run headless browser tests

Making behat use phantomjs for the tests

If you want to run it on phantomjs (a headless browser) you can add this profile to your behat.yml and you need phantomjs >= 1.8.0

phantomjs:
    extensions:
        Behat\MinkExtension\Extension:
            base_url: http://dev.local
            goutte: ~
            selenium2:
 wd_host: "http://localhost:8643/wd/hub"