Skip to content

Instantly share code, notes, and snippets.

View guidomb's full-sized avatar

Guido Marucci Blas guidomb

View GitHub Profile
@guidomb
guidomb / I18njs-hbs-helper.js
Created May 21, 2012 18:51
Handlebars helper for I18n-js library
/**
* A handler for calling the I18n.t method of the I18n-js library.
*
* @param key The message key.
* @param args [Optional] Optional arguments that must
* be passed to the I18n.t method.
* @return The message returned by I18n.t method.
*/
Handlebars.registerHelper('I18n', function(key, args) {
// Transforms arguments object to array
@guidomb
guidomb / .gitconfig
Created September 5, 2013 20:41
My gitconfig
[user]
name = YOUR NAME
email = YOUR EMAIL
[color]
diff = auto
status = auto
branch = auto
interactive = auto
[core]
editor = vim
@guidomb
guidomb / JsonCrudController
Created October 30, 2013 20:16
A generic Play! controller for JSON based resources that are persisted using a Repository. Is inspired in http://mandubian.com/2013/01/13/JSON-Coast-to-Coast/
package controllers
import play.api.mvc._
import scala.concurrent.Future
import repositories.Repository
import repositories.Repository._
import json.transformers.Generic
import play.api.libs.json._
import play.libs.Akka
@guidomb
guidomb / gist:af92f2e7b9f1718a7c55
Last active August 29, 2015 14:19
Pull request description template
@guidomb
guidomb / pull-request.rb
Last active August 29, 2015 14:19
Creates a pull request in Github the Wolox way!
require 'tempfile'
require 'securerandom'
def ask(question, new_lines_to_stop = 3)
puts "#{question}\n"
new_lines_count = 0
result = ""
while new_lines_count < new_lines_to_stop do
line = STDIN.readline
result << line
@guidomb
guidomb / syrmo-pr-template.md
Last active September 1, 2015 17:09
Syrmo's mobile app pull request's description template
@guidomb
guidomb / dependency-injection.m
Created November 13, 2015 20:33
How to manage missing dependencies
typedef MyChildViewModel *(^MyChildViewModelFactory)(MyService *);
@interface MyViewModel: NSObject
@property (nonatomic, readonly) RACSignal * presentChildViewModel;
- (instancetype)initWithServiceA:(ServiceA *)service;
- (void)someMethod;
import Social
import Accounts
enum Result<T> {
case Success(T)
case Failure(NSError)
}
struct Tweet {
import Foundation
import Result
typealias JSON = [String : AnyObject]
struct Tweet {
let message: String
let username: String
@guidomb
guidomb / database.json
Last active May 23, 2019 15:54
Firebase database model example for a Twitter-like application
{
"users": {
"280598f1-e31e-4ced-845e-c8dd10e11ec3": {
"first_name": "Guido",
"last_name": "Marucci Blas",
"username": "guidomb",
"email": "guidomb@wolox.com.ar"
},
"280598f1-e31e-4ced-845e-c8dd10e11ad5": {