Skip to content

Instantly share code, notes, and snippets.

View Miuler's full-sized avatar
🦀
Mi nueva pacion, Rust!

Hector Miuler Malpica Gallegos Miuler

🦀
Mi nueva pacion, Rust!
View GitHub Profile
import play.api.libs.json._
import play.api.libs.functional.syntax._
import play.api.data.validation._
implicit def tuple2Reads[A, B](implicit aReads: Reads[A], bReads: Reads[B]): Reads[Tuple2[A, B]] = Reads[Tuple2[A, B]] {
case JsArray(arr) if arr.size == 2 => for {
a <- aReads.reads(arr(0))
b <- bReads.reads(arr(1))
} yield (a, b)
case _ => JsError(Seq(JsPath() -> Seq(ValidationError("Expected array of two elements"))))
@Miuler
Miuler / 0_reuse_code.js
Created October 11, 2013 16:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Miuler
Miuler / app.js
Created November 2, 2013 07:12 — forked from rktjmp/app.js
// Make our app module, its easier to do this in raw javascript
// and then put the rest of our app content (controllers etc)
// in their own coffeescript files.
//
// Your ng-app should include this module name, eg: <html ng-app="TodoApp">
angular.module('TodoApp', []);
# Original source at: http://angularjs.org/#todo-js
window.TodoCtrl = ($scope) ->
$scope.todos = [
{text: 'learn angular', done: true},
{text: 'build an angular app', done: false}
]
$scope.addTodo = ->
.done-true {
text-decoration: line-through;
color: grey;
}
TodoCtrl = ($scope) ->
$scope.todos = [
text: "learn angular"
done: true
,
text: "build an angular app"
done: false
]
$scope.addTodo = ->
TodoCtrl = ($scope) ->
$scope.todos = [
text: "learn angular"
done: true
,
text: "build an angular app"
done: false
]
$scope.addTodo = ->
class TodoCtrl
constructor: ($scope) ->
$scope.todos = [
text: "learn angular"
done: true
,
text: "build an angular app"
done: false
]
class BaseCtrl
constructor: ->
console.log("All your base are belong to us!")
toJson: (item) ->
JSON.stringify(item)
class TodoCtrl extends BaseCtrl
constructor: (@$scope) ->
super
@Miuler
Miuler / sbt-plugin-ranking-2017-08-05.md
Created August 6, 2017 00:10 — forked from eed3si9n/ sbt-plugin-ranking-2017-08-05.md
List of sbt plugins sorted by GitHub stars. This was generated using https://gist.github.com/eed3si9n/ea4ceef0c5e5c07d6e62c87bea029f88, then augmented by hand.