Skip to content

Instantly share code, notes, and snippets.

Avatar

Sébastien Heymann sheymann

View GitHub Profile
View materialDesignShadowHelper.less
/**
* 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:
View sigma.plugins.community.js
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 Jan 6, 2015
Create a Neo4j database from Crunchbase data in Excel
View crunchbase-to-neo4j.cql
//-----------------------
//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 ';'
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
test
View node_debian_init.sh
#!/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
View avgdegree.groovy
#!/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
View linkurious.js
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 Feb 28, 2013
Fruchterman-Reingold layout plugin for Sigma.js with automatic cooling and stopping condition.
View sigma.fruchterman.js
/**
* 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 Oct 18, 2012
Internal Link Detection on Bipartite Graph
View internal_links.py
@sheymann
sheymann / entries.md
Created Jun 7, 2012 — forked from samuelclay/entries.md
Top entries in Knight News Challenge 2012
View entries.md