Skip to content

Instantly share code, notes, and snippets.

View sergiors's full-sized avatar
🎯
Focusing

Sérgio R Siqueira sergiors

🎯
Focusing
View GitHub Profile
@sergiors
sergiors / gist:54b8f042bed1f0adc007
Last active August 29, 2015 14:21
Patch to work with Flux at Backbone
_.each(['Collection'], function(name) {
var collection = Backbone[name];
collection.prototype.addChangeListener = function(callback) {
this.on('all', callback)
}
collection.prototype.removeChangeListener = function(callback) {
this.off('all', callback);
}
@sergiors
sergiors / gist:75bbadcece53ed89f632
Last active August 29, 2015 14:20
symfony form
class User extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name', 'text')
->add('email', 'email')
->add('password', 'password');
}
@sergiors
sergiors / gulpfile.js
Created January 13, 2015 23:49
React Task
var gulp = require('gulp')
, source = require('vinyl-source-stream')
, browserify = require('browserify')
, reactify = require('reactify')
gulp.task('bundle', function() {
browserify({
entries: ['./public/scripts/dd/bootstrap.js'],
transform: ['reactify']
})
var fs = require("fs");
module.exports = {
play: function(req, res) {
var path = "video.mp4";
var stat = fs.statSync(path);
var total = stat.size;
if (req.headers["range"]) {
var range = req.headers.range;