This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'] | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User extends AbstractType | |
{ | |
public function buildForm(FormBuilderInterface $builder, array $options) | |
{ | |
$builder | |
->add('name', 'text') | |
->add('email', 'email') | |
->add('password', 'password'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var User = (function() { | |
'use strict'; | |
var user = {}; | |
function User(attrs) { | |
user.profile = attrs.profile || {}; | |
user.address = attrs.address || {}; | |
user.payments = attrs.payments || {}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.each(['Model', 'Collection'], function(name) { | |
var ctor = Backbone[name]; | |
var fetch = ctor.prototype.fetch; | |
ctor.prototype.fetch = function() { | |
this.trigger('fetch', this); | |
return fetch.apply(this, arguments); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// before | |
var fib = function(n) { | |
if (n <= 1) { | |
return n; | |
} | |
else { | |
return fib(n - 1) + fib(n - 1); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function(require) { | |
'use strict'; | |
var React = require('react'); | |
var dom = React.DOM; | |
return React.createClass({ | |
propTypes: { | |
onClose: React.PropTypes.func.isRequired | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// see before https://github.com/sergiors/vanilla | |
(function() { | |
'use strict'; | |
var state = document.getElementById('address_state'); | |
state.on('change', function() { | |
var city = document.getElementById('address_city'); | |
city.setAttribute('disabled', true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Inbep\Doctrine\Query\PostgreSql; | |
use Doctrine\ORM\Query\AST\Functions\FunctionNode; | |
use Doctrine\ORM\Query\Lexer; | |
use Doctrine\ORM\Query\Parser; | |
use Doctrine\ORM\Query\SqlWalker; | |
class JsonbHashGreaterGreater extends FunctionNode | |
{ |
OlderNewer