This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package foo; | |
// imports skipped | |
/** | |
* @author @algrison | |
*/ | |
@Getter // generate getters | |
@Setter // generate setters | |
@Aspect // we are an aspect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id":"266d9729-7678-4e5d-8ddb-40d2c5631d0c", | |
"url":"http://random.cat/i/065_-_AhrGPRl.gif" | |
}, | |
{ | |
"id":"ccaa6a40-d3a5-4761-8f85-ca9e5ad8623a", | |
"url":"http://random.cat/i/dDVns.gif" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" | |
xmlns:gs="http://ws.foo"> | |
<soapenv:Header/> | |
<soapenv:Body> | |
<gs:getRandomCatRequest /> | |
</soapenv:Body> | |
</soapenv:Envelope> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use '[clojure.string :only (split-lines)] | |
'[clojure.set :only (intersection)]) | |
(->> (slurp *in*) split-lines rest (map set) (apply intersection) count println) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use '[clojure.string :only (split-lines)] | |
'[clojure.set :only (intersection)]) | |
(->> split-lines (slurp *in*) | |
rest | |
(map set) | |
(apply intersection) | |
count | |
println) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download it all | |
wget \ | |
--recursive \ | |
--no-clobber \ | |
--page-requisites \ | |
--html-extension \ | |
--convert-links \ | |
--restrict-file-names=windows \ | |
--domains ricostacruz.com \ | |
--no-parent \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** See: http://zeroturnaround.com/fun/magical-java-puzzle-pat-the-unicorns/ */ | |
import java.util.*; | |
public class Unicorn { | |
static Set<Integer> lines = new HashSet<Integer>(); | |
public static boolean pat() { | |
int callerLine = Thread.currentThread().getStackTrace()[3].getLineNumber(); | |
return lines.add(callerLine); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
See: http://thecodersbreakfast.net/index.php?post/2013/02/18/Coding-challenge-maman-les-petits-avions | |
--- | |
compile & run: | |
$ ocamlfind ocamlc -package batteries -linkpkg avions.ml -o avions | |
$ ./avions | |
*) | |
open Batteries;; | |
(* The syracuse suite *) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
See: http://beust.com/weblog/2008/06/27/ | |
--- | |
compile & run: | |
$ ocamlfind ocamlc -package batteries -linkpkg challenge.ml -o challenge | |
$ ./challenge | |
*) | |
open Batteries; | |
(* Test whether a number have repeating digits *) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MATCH (n1)-[r]->(n2) | |
WITH labels(n1) AS node1_labels, type(r) AS relation_type, labels(n2) AS node2_labels | |
UNWIND node1_labels as node1_label | |
UNWIND node2_labels as node2_label | |
MERGE (n1:Meta_Node {name: node1_label}) | |
MERGE (n2:Meta_Node {name: node2_label}) | |
MERGE (n1)-[:META_RELATIONSHIP {name:relation_type}]->(n2) |