Skip to content

Instantly share code, notes, and snippets.

View darekmydlarz's full-sized avatar
👨‍💻
Senior Software Engineer

Dariusz Mydlarz darekmydlarz

👨‍💻
Senior Software Engineer
View GitHub Profile
@darekmydlarz
darekmydlarz / jit_test_gen.py
Created April 10, 2012 21:28
Generate test data for JIT Library
#!/usr/bin/env python
import random
# does nodes need to have edges?
createEdges = True
# number of nodes
nodes = 500
def main():
for i in range(0, nodes):
@darekmydlarz
darekmydlarz / neo4j-scala.scala
Created July 29, 2012 09:13
Scala + Neo4j sample
import org.neo4j.graphdb.RelationshipType
import org.neo4j.kernel.EmbeddedGraphDatabase
import org.neo4j.graphdb.GraphDatabaseService
import org.neo4j.graphdb.Node
import org.neo4j.graphdb.Relationship
object RelTypes extends Enumeration {
type RelTypes = Value
val KNOWS, MAYOR_OF = Value
@darekmydlarz
darekmydlarz / neo4j-java.java
Created July 29, 2012 09:14
Java + Neo4j Sample
import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import org.neo4j.graphdb.Direction;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.RelationshipType;
import org.neo4j.graphdb.Transaction;
@darekmydlarz
darekmydlarz / neo4j-java-blueprints.java
Created July 29, 2012 09:47
Java + Neo4j + Blueprints
import java.util.Iterator;
import com.tinkerpop.blueprints.Direction;
import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.blueprints.impls.neo4j.Neo4jGraph;
public class EmbeddeNeo4j {
public static void main(final String[] args) {
@darekmydlarz
darekmydlarz / scala-neo4j-blueprints.scala
Created July 29, 2012 13:00
Scala + Neo4j + Blueprints
import com.tinkerpop.blueprints.Graph
import com.tinkerpop.blueprints.impls.neo4j.Neo4jGraph
import com.tinkerpop.blueprints.Vertex
import com.tinkerpop.blueprints.Edge
import java.util.Iterator
import com.tinkerpop.blueprints.Direction
object BlueprintsNeo4j {
def main(args: Array[String]): Unit = {
val graph : Graph = new Neo4jGraph("tmp/graph")
@darekmydlarz
darekmydlarz / scala-gson.scala
Created September 5, 2012 17:48
Scala + Gson
// lib to add: http://code.google.com/p/google-gson/downloads/detail?name=google-gson-2.2.2-release.zip&can=2&q=
// file Main.scala
package demo
import scala.collection.JavaConverters._
import com.google.gson.Gson
import java.util.ArrayList
import java.lang.reflect.Type
import com.google.gson.reflect.TypeToken
@darekmydlarz
darekmydlarz / 0_reuse_code.js
Last active August 29, 2015 14:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@darekmydlarz
darekmydlarz / telnet-imap
Created October 20, 2015 13:10 — forked from gustavohenrique/telnet-imap
playing with gmail via telnet
openssl s_client -crlf -connect imap.gmail.com:993
tag login [email protected] passwordhere
tag list "" "*"
tag select "inbox"
tag fetch 1:3 body[header]
tag fetch 3 body[header]
tag fetch 3 body[text]
tag fetch 2 all
tag fetch 2 fast
tag fetch 2 full
@darekmydlarz
darekmydlarz / es_pri_allocate_unassigned.md
Created March 24, 2016 08:08 — forked from ianblenke/es_pri_allocate_unassigned.md
elasticsearch trying to allocate a primary shard which is disabled

Allow routing allocations:

curl -XPUT localhost:9200/_cluster/settings -d '{
                "transient" : {
                    "cluster.routing.allocation.enable" : "all"
                }
        }'
@darekmydlarz
darekmydlarz / build.gradle
Created March 24, 2016 12:42 — forked from ysb33r/build.gradle
HOWTO ignore spock tests when gradle is run offline
// Check whether --offline was passed to gradle and set it in the test configuration's system properties
test {
if(gradle.startParameter.isOffline()) {
systemProperties 'TESTS.ARE.OFFLINE' : '1'
}
}