Skip to content

Instantly share code, notes, and snippets.

View slorber's full-sized avatar
🏠
Working from home

Sébastien Lorber slorber

🏠
Working from home
View GitHub Profile
'use strict';
var React = require("react/addons");
var DeepFreeze = require("common/deepFreeze");
var AtomUtils = require("state/atom/atomUtils");
var AtomCursor = require("state/atom/atomCursor");
function noop() { } // Convenient but probably not performant: TODO ?
var AppState = function() { };
AppState.prototype = {
updateAppState: function(updateFunction) {
console.debug("before updating:",this);
console.debug("before updating:",this.constructor);
console.debug("before updating:",new this.constructor());
console.debug("before updating:",new this.prototype.constructor());
Preconditions.checkMandatoryParameter(updateFunction,"updateFunction is required");
var AppState = function() { };
AppState.prototype = {
updateAppState: function(updateFunction) {
console.debug("before updating:",this);
console.debug("before updating:",this.prototype.constructor);
console.debug("before updating:",this.constructor);
console.debug("before updating:",new this.constructor());
console.debug("before updating:",new this.prototype.constructor());
'use strict';
var React = require("react/addons");
var Q = require("q");
var Main = require("components/layout/main");
var CurrentUserService = require("services/currentUserService");
var ApiRequestSessionHolder = require("repositories/utils/apiRequestSessionHolder");
var Spaces = React.createClass({
propTypes: {
appState: React.PropTypes.object.isRequired,
updateAppState: React.PropTypes.func.isRequired
},
// TODO temporary to fluidify the carousel swipes, probably not so good
shouldComponentUpdate: function(nextProps,nextState) {
{
"_readableState":{
"highWaterMark":16384,
"buffer":[
],
"length":0,
"pipes":null,
"pipesCount":0,
"flowing":false,
var Stamples = React.createClass({
mixins: [ScrollbarNearBottomMixin],
NumberOfItemsParPage: 10,
propTypes: {
appState: React.PropTypes.object.isRequired,
updateAppState: React.PropTypes.func.isRequired
var browserify = require('browserify');
var gulp = require('gulp');
var gutil = require('gulp-util');
var handleErrors = require('../util/handleErrors');
var source = require('vinyl-source-stream');
var wrench = require('wrench');
var path = require('path');
var fs = require('fs');
onEditorKeyUp: function(e) {
var intercepted = this.interceptKeyUpDownEventsForSuggestionView(e,false);
if ( !intercepted ) {
this.handleModifiedSuggestionsUnwrapping();
this.startAutosaveTimerIfWordKey(e);
// /!\ The suggestion dropdown must absolutely be bound to keyup (and not keydown)
// because the currently typed char is not yet inserted in the editor!
this.maybeShowSuggestionsDropdownView();
}
@slorber
slorber / gist:7448862
Created November 13, 2013 13:10
Akka actor to watch FS changes
import akka.actor.{ ActorRef, ActorSystem, Props, Actor }
import java.nio.file._
import java.io.File
import scala.concurrent.duration._
import scala.collection.JavaConversions._
import scala.Some
case class WatchDirectory(path: Path,resursive: Boolean = true)