Skip to content

Instantly share code, notes, and snippets.

View humandb's full-sized avatar

Javier Lopez humandb

View GitHub Profile
def my_pow(x: Float, n: Int): Float = {
if (n == 0) {
1
} else {
/ **
* If you ommit this if it won´'t finishe
*/
if (n == 2) {
x * x
@humandb
humandb / pre-commit
Created October 2, 2014 15:45
Pre-Commit hook to fix type before commiting
#!/bin/sh
#
# Fix common typo in Righster (note, not 't') automatically
git ls-tree -r --name-only HEAD | xargs perl -p -i -e 's/ighster/ightster/g'
git ls-tree -r --name-only HEAD | xargs perl -p -i -e 's/IGHSTER/IGHTSTER/g'
@humandb
humandb / request.json
Last active August 29, 2015 14:07
Delivery Service - S3 to Youtube API call
{
"items" : [
{
"source" : {
"uri" : "s3://path/to/file.mp4",
"metadata" : {}
},
"destination" : {
"uri" : "youtube://owner/channel-id",
"metadata" : {
@humandb
humandb / sender_test.scala
Last active August 29, 2015 14:16
Akka `sender` discussion
package com.rightster
import akka.actor.{Props, Actor, ActorSystem}
/**
* The output of this code is
*
* Message 1 sent
* Message 2 sent
* Sender 1 sends you a message
package com.rightster.ingest.unit.route
import org.apache.camel.builder.RouteBuilder
import org.apache.camel.test.junit4.CamelTestSupport
import org.junit.Test
class MultipleThreadsTest extends CamelTestSupport {
val messages = 40