Skip to content

Instantly share code, notes, and snippets.

@pram
pram / posts.jsx
Created August 25, 2016 06:34
Simple react meteor example
Posts = new Mongo.Collection('posts');
PostsContainer = React.createClass({
mixins: [ReactMeteorData],
getInitialState() {
return {
inc: 10,
limit: 10
};
},
@pram
pram / geotwitterstream.java
Created August 17, 2016 06:10
twitter4j get geo enabled data
import twitter4j.util.*;
import twitter4j.*;
import twitter4j.management.*;
import twitter4j.api.*;
import twitter4j.conf.*;
import twitter4j.json.*;
import twitter4j.auth.*;
TwitterStream twitterStream;
## Some Context
Neo4jClient just gives you a nice way to execute Cypher commands against a Neo4j instance. You always need to start with a working Cypher query, then you can write it in C#.
This page just shows some examples of how to translate different Cypher queries into C#.
For more explanation about how we handle parameters, immutable query objects, custom return clauses and things like that, you should really take the time to read the main [Neo4jClient Cypher documentation](cypher) that we have published. This page is just examples.
## Neo4j Versions
@pram
pram / graph.json
Created May 4, 2016 19:10
D3 link using id instead of position
{
"nodes": [
{"id": "red"},
{"id": "orange"},
{"id": "yellow"},
{"id": "green"},
{"id": "blue"},
{"id": "violet"}
],
"links": [
@pram
pram / .git-commit-template.txt
Created March 10, 2016 21:43 — forked from adeekshith/.git-commit-template.txt
A Git commit template to make it easy to enforce a good and uniform commit message style across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@pram
pram / fa-icons.json
Created March 6, 2016 17:40
Font Awesome 4.5 Icons
[
{
"name": "Glass",
"id": "glass",
"unicode": "f000",
"created": 1,
"filter": [
"martini",
"drink",
"bar",
@pram
pram / IntelliJ_IDEA__Perf_Tuning.txt
Created October 18, 2015 16:49 — forked from P7h/IntelliJ_IDEA__Perf_Tuning.txt
Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
-server
-Xms2048m
-Xmx2048m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1
@pram
pram / Cafe_Coffee.scala
Created September 24, 2015 12:44
Scala Worksheet
class Coffee(val flavour: String, val price: Int = 25) {
override def toString: String = flavour + " " + price.toString
}
class CreditCard(val number: Int) {
override def toString: String = number.toString
}
case class Charge(card: CreditCard,cost: Double) {
def combine(other: Charge): Charge =
@pram
pram / reverse.scala
Created September 23, 2015 07:21
Scala Reversing Strings
def reverse_tail2(s: String): String = {
@scala.annotation.tailrec
def impl(ss: String, r: String): String = {
if (ss == null) return null
if (ss.tail.isEmpty) return ss.head + r
impl(ss.tail, ss.head + r)
}
impl(s, "");
}
@pram
pram / load_recipes.js
Created August 28, 2015 10:28
Open Recipes Elasticsearch loader
var fs = require('fs');
var es = require('elasticsearch');
var client = new es.Client({
host: 'localhost:9200'
});
fs.readFile('recipeitems-latest.json', {encoding: 'utf-8'}, function(err, data) {
if (err) { throw err; }
// Build up a giant bulk request for elasticsearch.