Skip to content

Instantly share code, notes, and snippets.

View rubensayshi's full-sized avatar

Ruben de Vries rubensayshi

  • Amsterdam, Netherlands
View GitHub Profile
/**
* Copyright (c) 2013 Xcellent Creations, Inc.
*
* 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 furnished to do so, subject to
* the following conditions:
@rubensayshi
rubensayshi / foo.js
Created June 7, 2012 15:56 — forked from jrunning/foo.js
Getting a class property from an instance of a Backbone.js model (without naming the class explicitly)
var C = Backbone.Model.extend({
foo : function() { return this.constructor.bar; }
}, {
bar : 123
});
var ci = new C;
ci.foo();
// -> 123
@rubensayshi
rubensayshi / SequenceFileKeyInputFormat.java
Created April 19, 2012 15:48 — forked from dilip/SequenceFileKeyInputFormat.java
SequenceFileInputFormat and SequenceFileKeyRecordReader for enabling Hive to access data stored in a sequence file's key
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@rubensayshi
rubensayshi / AmountModel.php
Created July 21, 2011 13:37 — forked from winzou/AmountModel.php
Subform Validation
<?php
namespace Asso\BookBundle\Form;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\ExecutionContext;
/**
* @Annotation
*/
@rubensayshi
rubensayshi / JoomlaSessionStorage.php
Created June 24, 2011 21:18 — forked from naderman/JoomlaSessionStorage.php
Joomla! Symfony Integration Proof of Concept
<?php
namespace phpBB\JoomlaIntegration;
use Symfony\Component\HttpFoundation\SessionStorage\SessionStorageInterface;
class JoomlaSessionStorage implements SessionStorageInterface
{
protected $jSession;
@rubensayshi
rubensayshi / symfony.info
Created June 19, 2011 11:29 — forked from naderman/symfony.info
Drupal 7.0 Symfony2 Integration (Proof of Concept)
name = Symfony
description = Symfony Integration
core = 7.x
@rubensayshi
rubensayshi / bash-git-prompt
Created June 18, 2011 20:00 — forked from elecnix/bash-git-prompt
bash-git-prompt
#!/bin/bash
#
# Displays the current git branch name and the dirty state in your Bash shell
# prompt. Add a line like this to your ~/.bashrc file:
#
# . ~/path/to/gist/bash-git-prompt
#
# To use this, you must enable "enable programmable completion features".
# Look at your ~/.bashrc for something like:
#