Skip to content

Instantly share code, notes, and snippets.

View sheymann's full-sized avatar

Sébastien Heymann sheymann

View GitHub Profile
/**
* A mixin which helps you to add depth to elements according to the Google Material Design spec:
* http://www.google.com/design/spec/layout/layout-principles.html#layout-principles-dimensionality
*
* Please note that the values given in the specification cannot be used as is. To create the same visual experience
* the blur parameter has to be doubled.
*
* Author: Florian Kutschera (@gefangenimnetz), Conceptboard GmbH (@conceptboardapp)
*
* Example usage:
var jLouvain = function () {
//Constants
var __PASS_MAX = -1
var __MIN = 0.0000001
//Local vars
var original_graph_nodes;
var original_graph_edges;
var original_graph = {};
var partition_init;
@sheymann
sheymann / crunchbase-to-neo4j.cql
Created January 6, 2015 14:06
Create a Neo4j database from Crunchbase data in Excel
//-----------------------
//Import the cities
//-----------------------
CREATE CONSTRAINT ON (e:CITY) ASSERT e.name IS UNIQUE;
//Create the companies' cities
USING PERIODIC COMMIT 2000
LOAD CSV WITH HEADERS FROM "file:c:/Companies.csv" AS line
FIELDTERMINATOR ';'
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
test
#!/bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
#!/usr/bin/env groovy
import org.gephi.data.attributes.api.AttributeController
import org.gephi.graph.api.GraphController
import org.gephi.io.importer.api.EdgeDefault
import org.gephi.io.importer.api.ImportController
import org.gephi.io.processor.plugin.DefaultProcessor
import org.gephi.project.api.ProjectController
import org.gephi.statistics.plugin.Degree
import org.openide.util.Lookup
sigi = sigma.instances[1];
var prefix = /.{7}/;
sigi.iterNodes(function (node) {
node.label = node.attr.kind + ": " + node.attr.name.replace(prefix, '');
});
WebFontConfig = {
google: { families: [ 'Lato::latin' ] }
@sheymann
sheymann / sigma.fruchterman.js
Created February 28, 2013 15:37
Fruchterman-Reingold layout plugin for Sigma.js with automatic cooling and stopping condition.
/**
* Linkurious 2012, all rights reserved.
* Sébastien Heymann <seb@linkurio.us>,
* Romain Yon <romain@linkurio.us>
*
* Please use http://jsbeautifier.org/ and indent with 2 spaces.
*
* Lib docs:
* http://twitter.github.com/bootstrap/
* http://docs.jquery.com/
@sheymann
sheymann / internal_links.py
Created October 18, 2012 13:24
Internal Link Detection on Bipartite Graph
@sheymann
sheymann / entries.md
Created June 7, 2012 15:51 — forked from samuelclay/entries.md
Top entries in Knight News Challenge 2012