Skip to content

Instantly share code, notes, and snippets.

View fedesilva's full-sized avatar
👁️‍🗨️

federico silva fedesilva

👁️‍🗨️
View GitHub Profile
@fedesilva
fedesilva / multiple_ssh_setting.md
Created November 29, 2015 15:48 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@fedesilva
fedesilva / anda.conf
Created October 21, 2015 14:13
nginx configs
upstream app {
server localhost:9000;
}
server {
listen 80;
server_name leases.counselytics.net;
# Application root
/*
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
import akka.actor.ActorSystem
import akka.http.Http
import akka.http.Http.IncomingConnection
import akka.http.model.HttpEntity
import akka.http.model.Multipart.FormData
import akka.http.server.{ Directives, Route, RoutingSetup }
@fedesilva
fedesilva / build.sbt
Last active August 29, 2015 14:23
Putting the sha where it belongs.
name := "test-build"
organization := "org.cosomojo"
version := "1.0.0-SNAPSHOT"
val sha = settingKey[String]("current git commit SHA")
sha in ThisBuild := Process("git rev-parse HEAD").lines.head.take(8)
version := s"${version.value}" + (if (version.value.contains("-SNAPSHOT")) "" else s"-${sha.value}")
import annotation.unchecked.uncheckedVariance
/** The trait of things that can be compared safely */
trait Equals[-T] {
/** A witness of Equals' type parameter. Should only used for
* the constraint in EqlDecorator, hence, @uncheckedVariance should not be a problem.
*/
type EqualsDomain = T @uncheckedVariance
package scalax.collection
import scala.collection.mutable.ListBuffer
/** FoldTransformers and the views based on them are a Scala
* adaptation, and to some degree an extension, of Rich Hickey's
* transducers for Clojure. They show that the concepts can be
* implemented in a type-safe way, and that the implementation is
* quite beautiful.
*/
object FoldingViews {

Introduction to scalaz-stream

Every application ever written can be viewed as some sort of transformation on data. Data can come from different sources, such as a network or a file or user input or the Large Hadron Collider. It can come from many sources all at once to be merged and aggregated in interesting ways, and it can be produced into many different output sinks, such as a network or files or graphical user interfaces. You might produce your output all at once, as a big data dump at the end of the world (right before your program shuts down), or you might produce it more incrementally. Every application fits into this model.

The scalaz-stream project is an attempt to make it easy to construct, test and scale programs that fit within this model (which is to say, everything). It does this by providing an abstraction around a "stream" of data, which is really just this notion of some number of data being sequentially pulled out of some unspecified data source. On top of this abstraction, sca

@fedesilva
fedesilva / anteldata-Sat Mar 7 20:33:15 UYST 2015
Created March 7, 2015 22:34
Anteldata Pédrida de Paquetes - Sat Mar 7 20:33:15 UYST 2015
PING google.com (200.40.172.45): 56 data bytes
Request timeout for icmp_seq 0
64 bytes from 200.40.172.45: icmp_seq=1 ttl=60 time=34.040 ms
64 bytes from 200.40.172.45: icmp_seq=2 ttl=60 time=18.401 ms
64 bytes from 200.40.172.45: icmp_seq=3 ttl=60 time=88.053 ms
Request timeout for icmp_seq 4
64 bytes from 200.40.172.45: icmp_seq=5 ttl=60 time=154.794 ms
64 bytes from 200.40.172.45: icmp_seq=6 ttl=60 time=13.870 ms
64 bytes from 200.40.172.45: icmp_seq=7 ttl=60 time=13.168 ms
64 bytes from 200.40.172.45: icmp_seq=8 ttl=60 time=11.056 ms
Llegó? Salude...
Se va? Despídase...
Encendió? Apague...
Abrió? Cierre...
Desarmó? Arme...
Rompió? Arregle...
Ensució? Limpie...
Mojó? Seque...
No sabe cómo funciona? No toque...
No sabe hacerlo mejor? No critique...
References:
http://blog.carbonfive.com/2012/02/27/supporting-cross-domain-ajax-in-rails-using-jsonp-and-cors/
https://github.com/cyu/rack-cors
http://nelm.io/blog/2011/11/cors-with-sencha-touch/
http://jessehowarth.com/2011/04/27/ajax-login-with-devise
=============================================================================================================
GEMFILE
=============================================================================================================
gem 'rack-cors', :require => 'rack/cors'