Skip to content

Instantly share code, notes, and snippets.

@SamyPesse
SamyPesse / walk.js
Created January 3, 2018 14:14
React async tree walker
/* @flow */
import * as React from 'react';
type ReactContext = Object;
/*
* Walk a react element.
*/
async function walkTree(
element: React.Element<*>,
@SamyPesse
SamyPesse / README.md
Created May 24, 2016 22:34
Complete example of code highlight for Draft.js with Prism

How to test it?

Copy the prism.js file under examples/prism/ in Draft.js repository. Run npm install prismjs Then open it in your browser.

@SamyPesse
SamyPesse / test.md
Last active January 18, 2017 15:20

!weird + id/for headings

您好

I ♥ you

Today I found £5

Schöner Titel läßt grüßen!? Bel été !

@SamyPesse
SamyPesse / summary.js
Last active January 6, 2016 14:14
Summary Generation for Code-Civil
var fs = require("fs");
var path = require("path");
var _ = require("lodash");
var utf8 = require('utf8');
require("natural-compare-lite");
var IGNORE = [
"node_modules",
".git",
"SUMMARY.md",
@SamyPesse
SamyPesse / test.md
Last active September 15, 2015 09:49

Hello from git

function AutoEscapeExtension(_env) {
this.tags = ['autoescape'];
this.parse = function(parser, nodes, lexer) {
// get the tag token
var tok = parser.nextToken();
// parse the args and move after the block end. passing true
// as the second arg is required if there are no parentheses
var args = parser.parseSignature(null, true);
define([
'hr/utils',
'hr/hr',
'hr/dom'
], function (_, hr, $) {
// Evnts for tablet and desktop
var events = {
'start': "mousedown",
'stop': "mouseup",
'move': "mousemove",
@SamyPesse
SamyPesse / gist:6859673
Created October 6, 2013 22:00
Track cigarettes to Reportr
# Find the rpeortr.py in examples/python
from reportr import Reportr
# Create a Reportr Client
client = Reportr(
host="http://www.reportr.io",
token="--token--")
# Define model for our event
client.model("like", "cigarette",
from gittle import Gittle
path = '/tmp/gittle_bare'
# Clone repository
repo = Gittle.clone('git://github.com/FriendCode/gittle.git', path)
# Information
print "Branches :"
print repo.branches