Skip to content

Instantly share code, notes, and snippets.

View drborges's full-sized avatar
🏠
Working from home

Diego Borges drborges

🏠
Working from home
View GitHub Profile
@drborges
drborges / Person.java
Created May 22, 2013 15:30
Spike on Jackson lib.
package com.mosso.cp.domain.rest.payment;
import com.mosso.cp.domain.rest.auth.wrappers.JsonNodeTransformer;
import com.mosso.cp.domain.rest.v2.auth.JsonDSL;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.hamcrest.CoreMatchers;
import org.junit.Assert;
import org.junit.Test;
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrant plug-ins in use:
# vagrant-vbguest to ensure all VirtualBox VMs have guest additions
# vagrant-hostmanager to manipulate /etc/hosts on the guest VMs and host machine.
# vagrant-proxyconf to configure an HTTP proxy for apt [requires instructor VM to be booted on an accessible IP]
#
# If vagrant-hostmanager isn't installed edit /etc/hosts on your laptop and place these entries in it.
# 172.16.1.10 web
<div notify-on="event.name"
notify-dismiss="dismiss()">You received a message</div>
var monitor = RequestsMonitor.monitor(function (result) {
$scope.$broadcast('requestsChanged', result);
});
@drborges
drborges / generator.go
Last active August 29, 2015 14:20
Go Channels Playground
package main
import "fmt"
import "time"
import "math/rand"
func generator() chan int {
future := make(chan int)
go func() {
for i := 0; i < 3; i++ {
@drborges
drborges / reversable.go
Last active August 29, 2015 14:21
Golang Sorting examples
package main
import "fmt"
type Message struct {
Value string
}
type Reversable []interface{}
public class Stack<T : Animal> {
public var items = [T]()
public func push(item: T) {
items.append(item)
}
public func pop() -> T {
return items.removeLast()
}
import (
"encoding/base64"
"fmt"
"net/http"
)
type BasicAuthTransport struct {
Username string
Password string
}
@drborges
drborges / pipelinev1.go
Last active August 29, 2015 14:23
Channel oriented pipeline prototypes
package appx
import (
"errors"
"appengine"
)
var ErrEmptySlice = errors.New("Cannot produce entities from an empty slice")
// Produce emits entities in the output channel until
@drborges
drborges / pipeline.go
Last active August 29, 2015 14:24
Channel based Producer --> Consumer implementation with simple recovery strategy
package main
import (
"errors"
"fmt"
"math/rand"
"time"
)
type Data interface{}