Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
login=$1
password=$2
repository=$3
command=curl
#command=echo
#Create a private repository in github
#Assign all usersname in githubusers.txt file to this repository.
#!/bin/bash
for num in $(seq 1 1 10) ; do echo foobar ; done ;
echo "baz, qix, what else ?"
package foo.bar;
import com.mycila.xmltool.XMLDoc;
import com.mycila.xmltool.XMLTag;
public class PoiBuilder {
public Poi buildFromXml(String xml) {
XMLTag xmlTag = XMLDoc.from(xml, true);
return new Poi(xmlTag.getText("//xml/address/way"), xmlTag.getText("//xml/address/town"));
@jeanlaurent
jeanlaurent / gist:928087
Created April 19, 2011 14:37
replace String in many files.
perl -p -i -e 's/relativePath>../relativePath>..\/../g' `find ./ -name pom.xml`
@jeanlaurent
jeanlaurent / ferme.sh
Created July 22, 2011 15:18
La ferme
#!/bin/sh
#Need MacOSX Lion with French voices...
say -v Sebastien "On bosse à la ferme !"
say -v Virginie "Quelle ferme ?"
say -v Sebastien "La ferm ta gueule !"
say -v Hysterical "AH AH"
@jeanlaurent
jeanlaurent / mvnrelease.sh
Created September 6, 2011 16:34
Help automate the release of maven artifacts
#!/bin/sh
function checkError {
if [ "$?" -ne "0" ]; then
echo ""
echo "ECHEC dans $1"
echo ""
exit 1
fi
}
package net.codestory;
import java.io.PrintStream;
import java.util.Map;
import com.google.common.collect.ImmutableSortedMap;
public class FooBarQix {
private Map<Character, String> keywords = ImmutableSortedMap.of('3', "Foo", '5', "Bar",
'7', "Qix");
@jeanlaurent
jeanlaurent / FunWithLambda.java
Created November 13, 2012 21:56
Fun With Lambda in jdk8
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import static com.google.common.collect.FluentIterable.from;
import static java.util.Arrays.asList;
import static java.util.streams.Streams.stream;
import static org.fest.assertions.Assertions.assertThat;
@jeanlaurent
jeanlaurent / DoubleMath
Created December 3, 2012 16:01
Double Precision Calculation in Java
import java.math.BigDecimal;
import static DoubleMath.Operation.ADD;
import static DoubleMath.Operation.DIVIDE;
import static DoubleMath.Operation.MULTIPLY;
import static DoubleMath.Operation.SUBSTRACT;
import static java.math.RoundingMode.HALF_EVEN;
@jeanlaurent
jeanlaurent / codestory_json_to_md.coffee
Created February 1, 2013 20:00
Read codestory data in json to markdown for a blog post
fs = require 'fs'
json = fs.readFileSync 'data.json.1','UTF-8'
data = JSON.parse json
data.sort (a,b) ->
b.perf - a.perf
for user in data when user.perf >= 1000
console.log "* ![](#{user.gravatar})#{user.name} #{user.perf}"