Skip to content

Instantly share code, notes, and snippets.

View fdecampredon's full-sized avatar

François de Campredon fdecampredon

  • Fadio IT
  • Marseille
View GitHub Profile
@fdecampredon
fdecampredon / gist:9687b27904d1eb25757a
Last active August 29, 2015 14:09
possible rx-react events integration
// in this first option events handlers are just RxJs functor Subject
// those subject are passed down to the render function and are manually injected into
// the properties of react component
var RxReact = require('rx-react');
var React = require('react');
@fdecampredon
fdecampredon / gist:86ccbba3863bccaec7dd
Last active November 25, 2015 21:58
Obtaining client window size on server
/*jshint node:true*/
var http = require('http');
var fs = require('fs');
var url = require('url');
var querystring = require('querystring');
var head = fs.readFileSync('head.html','UTF-8');
//<head>
// <meta charset="utf-8">
/*jshint node:true*/
var fs = require('fs'),
path = require('path');
var walk = function(dir, done) {
var results = [];
fs.readdir(dir, function(err, list) {
if (err) return done(err);
var pending = list.length;
if (!pending) return done(null, results);
/*
The MIT License (MIT)
Copyright (c) 2014 François de Campredon
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
declare module "libxmljs" {
export function parseXmlString(source:string):XMLDocument;
export function parseHtmlString(source:string):HTMLDocument;
export class XMLDocument {
constructor(version:number, encoding:string);
child(idx:number):Element;
childNodes():Element[];
@fdecampredon
fdecampredon / jquery.dynatree.d.ts
Created October 25, 2012 23:56
Dynatree typescript definition
interface JQuery {
dynatree(options?:DynatreeOptions):DynaTree;
dynatree(option?:string,...rest:any[]):any;
}
interface JQueryStatic {
ui:{
dynatree:DynatreeNamespace;
};
}
interface DynaTree {
@fdecampredon
fdecampredon / CodeMirror.d.ts
Created October 23, 2012 17:24
TypeScript CodeMirror Definition File
interface CodeMirrorScrollInfo {
x:number;
y:number;
width:number;
height:number;
}