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
<?php
namespace Sergiors\LinkedList;
class LinkedList
{
private $firstNode;
private $lastNode;
<?php
namespace Inbep\Inbep\Console\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Sergiors\Worker\Command\CommandInterface;
use Sergiors\Worker\Command\Invoker;
class DaemoniseCommand extends Command
<?php
namespace Inbep\Component\Doctrine\DBAL\Platforms\Keywords;
use Doctrine\DBAL\Platforms\Keywords\PostgreSQL92Keywords;
/**
* @author Sérgio Rafael Siqueira <[email protected]>
*/
class PostgreSQL92ContribKeywords extends PostgreSQL92Keywords
{
<?php
namespace Inbep\Twig\Extension;
/**
* @author Sérgio Rafael Siqueira <[email protected]>
*/
class MaskExtension extends \Twig_Extension
{
private $masks = [
'phone' => [
<?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
{
// 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);
define(function(require) {
'use strict';
var React = require('react');
var dom = React.DOM;
return React.createClass({
propTypes: {
onClose: React.PropTypes.func.isRequired
},
// before
var fib = function(n) {
if (n <= 1) {
return n;
}
else {
return fib(n - 1) + fib(n - 1);
}
};
@sergiors
sergiors / fetch.js
Created May 20, 2015 14:28
fetch event
_.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);
}
});
var User = (function() {
'use strict';
var user = {};
function User(attrs) {
user.profile = attrs.profile || {};
user.address = attrs.address || {};
user.payments = attrs.payments || {};
}