Skip to content

Instantly share code, notes, and snippets.

View olange's full-sized avatar
🚀

Olivier Lange olange

🚀
View GitHub Profile
@olange
olange / graphqlScalarDateTimeType.coffee
Last active April 8, 2016 17:55
Defines and exports a custom GraphQL scalar type that represents date and time with a time zone, which, while serialized as a string, promises to conform to ISO‐8601 format.
# Defines and exports a custom GraphQL scalar type that represents date and time,
# which, while serialized as a string, promises to conform to ISO‐8601 format.
# (adapted from https://github.com/soundtrackyourbrand/graphql-custom-datetype)
graphql = require 'graphql'
graphql_language = require 'graphql/language'
graphql_error = require 'graphql/error'
GraphQLScalarType = graphql.GraphQLScalarType
GraphQLError = graphql_error.GraphQLError
@olange
olange / mono-runtime-version.cs
Created March 4, 2016 15:40
Reading Mono Runtime version
using System.Reflection;
System.Type type = System.Type.GetType( "Mono.Runtime");
if( type != null) {
MethodInfo displayName = type.GetMethod( "GetDisplayName", BindingFlags.NonPublic|BindingFlags.Static);
if( displayName != null)
Debug.Log( "Mono Runtime version" + displayName.Invoke(null,null));
}
@olange
olange / ShowMyTransforms.cs
Last active January 20, 2016 18:10 — forked from david-hodgetts/ShowMyTransforms.cs
An Unity Gizmo that displays the origin and orientation of a _game object_ when it is selected in the _Editor_, displaying its right/forward/up as red/blue/green axis
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class ShowTransforms : MonoBehaviour {
private const float radius = 0.02f;
void OnDrawGizmosSelected() {
Vector3 origin, axisRight, axisForward, axisUp;
@olange
olange / neo4j-compiling.md
Last active August 27, 2015 22:57
Compiling Neo4j Community on my Mac OS X

Resume of the build instructions found in the Neo4j project page on GitHub.

### Compiling

$ export MAVEN_OPTS="-Xmx512m"
$ cd neo4j/community/
$ mvn [clean] install -Dlicense.skip=true -DskipTests
@olange
olange / neo4j-graphviz-runnning.md
Last active August 29, 2015 14:26
Getting Neo4j Graphviz command-line options right

### Running the Neo4j GraphViz module

The quotes around the nodeTitle, relationshipTitle and nodePropertyFilter must be escaped on the shell command-line, to get them to the graphviz main class:

$ ./graphviz ~/neo4j/data/graph.db \
             relationshipTitle=\"@type\" nodePropertyFilter=name

or

@olange
olange / graphviz-build-system-for-sublime.md
Created January 4, 2015 00:21
Graphviz (DOT) Build System for Sublime Text 2 and 3

To transform the currently opened Graphviz source file (in DOT Language) into a PNG:

{
    "cmd": [ "dot", "-Tpng", "-o", "$file_base_name.png", "$file"],
    "selector": "source.dot"
}

Usage

@olange
olange / accounting.factory.transaction.clj
Last active November 7, 2022 17:37
Answer to @puredanger's tweet: about the «trouble» I had first using type hints and records in Clojure.
(ns accounting.factory.transaction
(:require [accounting.model.transaction :as transaction]
[accounting.model.document :as document]
[accounting.model.movement :as movement])
(:import [accounting.model.transaction Transaction]
[accounting.model.document Document]
[org.joda.time LocalDate]))
(defn create-exchange-difference
^Transaction