View lols.coffee
class Animal
constructor: (@name) ->
move: (meters) ->
alert @name + " moved #{meters}m."
class Snake extends Animal
move: ->
alert "Slithering..."
super 5
View gist:68b64230e9270403526828d82ff2461e
brew install apple-gcc42 openssl libyaml libffi
xcode-select --install
export CC=/usr/local/bin/gcc-4.2
export CFLAGS='-g -O2'
export RUBY_CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl`
export CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl`
# I had to edit the svn repo URL in /usr/local/Cellar/ruby-build/20160913/share/ruby-build/1.8.7-p375 and change the URL from http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_7 to https://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_7
rbenv install 1.8.7-p375
View GIF-Screencast-OSX.md

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

View say_to_file.markdown

Create Aiff file from yout text input

You can do it like this say -f script.txt -o say_output.aiff with text file input or like this say "hello you cheeky scrublords" -o say_output.aiff

Converting to Mp3

Convert using lame like this lame -m m say_output.aiff final_speech.mp3

View Gateway.scala
// Simple bulk only Gateway
// url is for DR (Delivery Reports)
case class Service(name: String, url: String)
// Params your API gets in
case class HttpMessage(service: String, originator: String, msisdn: String, body: String)
// Handles MT's and MO's (maybe should contain service name for sake of simplicity)
case class MQMessage(guid: String, msisdn: String, originator: String, body: String)
// Types of DR's you could send
View gist:463586d764287971fc6c28a3f85294b3
Dear Team
What are we trying to do:
We are trying to change -sname to -name within our existing cluster without taking the cluster down.
We had a call with basho and we were advised to take steps like here:
http://docs.basho.com/riak/1.4.9/ops/running/nodes/renaming/#Multi-Node-Clusters
They didn't work.
View gist:9487cfe49696278c1d51
data Configuration =
Configuration { path :: String,
localhost :: String,
remotehost :: String,
isguest :: Bool,
issuperuser :: Bool,
currentdir :: String,
homedir :: String,
timeconnected :: Integer
}
View promotions.rb
require 'minitest/autorun'
# Money are in floats for simplicity, it should be bigint
# Promotions are prioritized in order [A,B] => A rule is applied first, B rule is applied second
class Item
attr_accessor :name, :price, :product_code
def initialize(name, price, product_code)
@name = name
@price = price
View try_out_browser.scala
import javafx.application.Application
import javafx.geometry.HPos
import javafx.geometry.VPos
import javafx.scene.Node
import javafx.scene.Scene
import javafx.scene.layout.HBox
import javafx.scene.layout.Priority
import javafx.scene.layout.Region
import javafx.scene.paint.Color
import javafx.scene.web.WebEngine
View README.markdown

Sinatra like Web Framework for Scala

I tried few solutions like Scalatra, Play and for my POV Scalatra was a bit too bloated and big, didn't feel like sinatra at all. Play is more like Rails so you get everything. But spark is simple and easy to udnerstand. I didn't see any Scala example so i made one.

Sadly there are few things i don't like :(

If we would build DSL in a different way eg. we could have it like this:

  get(Route("/hello"){