Skip to content

Instantly share code, notes, and snippets.

View ignasi35's full-sized avatar
🚧
Breaking CI builds since 2001

Ignasi Marimon-Clos ignasi35

🚧
Breaking CI builds since 2001
View GitHub Profile
@ignasi35
ignasi35 / Readme
Created July 22, 2012 09:43
A copy of the m-continous-test-p readme
maven-continous-test-plugin
===========================
plugin for maven to continously run tests
THIS IS WORK IN PROGRESS!!!
The Idea
--------
package com.marimon.proof.image.manipulation;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
@ignasi35
ignasi35 / index.html
Last active December 13, 2015 16:59 — forked from darwin/index.html
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg);">
<scene id="scene1">
<label t="translate(0,346)">
@ignasi35
ignasi35 / WordWrap.scala
Created May 18, 2013 16:57
Scala solution to the Word Wrap Kata performed during 2013-05-18 at @softonic 's #katayuno
object WordWrap {
/**
* Returns the <code>input</code> text split into lines of length
* smaller or equal to <code>maxLength</code>. The newline
* character is not consistent with the platform, it's always a
* CR character. This input processing also replaces
* consecutive blank spaces with a single blank space.
*
* @param input the text we want to process.
@ignasi35
ignasi35 / new_gist_file
Created June 14, 2013 06:57
# Using ffmpeg to Record screen buffer content as video. Thanks @_gowdru http://twitter.com/climagic/status/345036838672674816
ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq ./out.mpg
@ignasi35
ignasi35 / new_gist_file
Created June 21, 2013 09:33
Split a file per lines or bytes or s/thing
split -l 50000 filename

Keybase proof

I hereby claim:

  • I am ignasi35 on github.
  • I am imarimonclos (https://keybase.io/imarimonclos) on keybase.
  • I have a public key whose fingerprint is 2525 626E 9413 ED41 B7E5 1846 982A 22EE BA44 BDD8

To claim this, I am signing this object:

@ignasi35
ignasi35 / tailrecursive loop
Created August 29, 2014 07:51
A tailrecursive counter to generate some test bytecode for jitwatch
import scala.annotation.tailrec
object Hello {
def main(args: Array[String]):Unit = {
val i = inc(0, 10000)
println(i)
}
@tailrec
def inc(i:Int, iter:Int):Int=if(iter>0) inc(i+1, iter-1) else i
@ignasi35
ignasi35 / custom_circuit_breaker.scala
Last active August 29, 2015 14:06 — forked from gszeliga/custom_circuit_breaker.scala
While reviewing the code at http://covariantblabbering.blogspot.com.es/2014/09/use-circuit-breakers-goddammit.html?view=classic I found some things I wanted to rewrite and ended up with this code.
package com.covariantblabbering
import java.util.concurrent.atomic.AtomicReference
import java.util.concurrent.atomic.AtomicInteger
import java.util.concurrent.atomic.AtomicLong
import scala.concurrent.duration.Duration
import scala.concurrent.duration._
import scala.util.{Failure, Success, Try}
// see http://www.meetup.com/Spark-Barcelona/events/220256138/
lazy val file1 = sc.textFile("smalldataset/pa*000000")
lazy val file123 = sc.textFile("smalldataset/pa*")
lazy val countries = sc.textFile("smalldataset/coun*")
val ex1 = file1.map(_.split("\\s")).map(pieces => pieces(0).split("\\.")(0)).distinct().count()
val ex2Filtered = file123.filter(line => line.startsWith("en") && line.contains(" Kayak "))
val ex2tupled = ex2Filtered.map(_.split("\\s")).map { pieces => (pieces(0).split("\\.")(0), pieces(2).toInt) }
val ex2 = ex2tupled.reduceByKey(_ + _).collect().mkString(",")