Skip to content

Instantly share code, notes, and snippets.

View fakenickels's full-sized avatar
💭
hello this is a mic test, are you listening

Gabriel Rubens Abreu fakenickels

💭
hello this is a mic test, are you listening
View GitHub Profile
@robotlolita
robotlolita / jquery.api.js
Last active December 17, 2015 21:59
Redesigning jQuery's API
// There are four main design concerns here:
// * The API should abstract only DOM manipulations
// — law of Do Just One Thing.
// * The API should not allow plugins modifying jQuery,
// these should be distinct modules/objects
// — law of Modularity.
// * The API should not use the DOM as a data model,
// because this makes all operations inherently slow
// — law of Orthogonality.
// * The API should be simple, consistent and easy to use
@stubailo
stubailo / answer.md
Last active July 12, 2016 06:46
Answer to Blaze question on Crater.io

Answer to Blaze question on crater.io

https://crater.io/comments/ucDz7fibgDcJqHtFu

Many of us want Blaze 2.0 and not Angular or React. Is MDG committed to continuing the development of Blaze? If so, how? Thanks!

TL;DR: I think the best thing to do is probably build Blaze 2.0 on top of the React rendering system to get a nice developer experience while taking advantage of new tech like React Native and the React component ecosystem.

Blaze is a very interesting part of the Meteor platform, from a platform point of view. Let's look at where we are now. Here are some of the benefits of Blaze:

@stbaer
stbaer / tinytest.api
Last active November 15, 2016 19:10
Meteor tinytest api
test.isFalse(v, msg)
test.isTrue(v, msg)
test.equal(actual, expected, message, not)
test.length(obj, len)
test.include(s, v)
test.isNaN(v, msg)
test.isUndefined(v, msg)
test.isNotNull
test.isNull
test.throws(func)
object ScalaJSExample extends js.JSApp{
def main() = {
val xs = Seq(1, 2, 3)
println(xs.toString)
val ys = Seq(4, 5, 6)
println(ys.toString)
val zs = for{
x <- xs
y <- ys
} yield x * y
@WolfDan
WolfDan / reForm.re
Last active January 8, 2018 22:49
ReForm validation proposal
/* Source from: https://github.com/Astrocoders/reform I edited it to handle the onChange events and validation */
type action =
| HandleChange((string, string))
| HandleSubmit;
type validation =
| Required
| MinLength(int)
| MaxLength(int)
| Between(int, int)
@richdouglasevans
richdouglasevans / Comonad.js
Last active November 1, 2018 09:00 — forked from i-am-tom/Comonad.js
Code for Game of Life from the Comonad article.
const { tagged } = require("daggy");
const Pair = tagged("Pair", ["_1", "_2"]);
//+ data Store p s = Store (p -> s) p
const Store = tagged("Store", ["lookup", "pointer"]);
Array.prototype.equals = function(that) {
return (
this.length === that.length &&
@hew
hew / _readme.md
Last active April 29, 2019 19:32
Reason React Native Styled System (Beta)

Reason React Native Styled System (Beta)

@NicolasT
NicolasT / nel.ml
Last active May 28, 2019 18:48
Playing with OCaml GADTs
type z
type 'a s
(* Sadly enough, without kind restrictions, this still allows nonsense types like *)
type nonsense = int s
(* GHC 7.6 supports this (lifting types to kinds & kind constraints) ;-) *)
type (_, _) llist =
| Nil : (z, 'a) llist
| Cons : ('a * ('l, 'a) llist) -> ('l s, 'a) llist
# add the email package
meteor add email

Idea

Reason is faster than JavaScript when using BuckleScript.

Why?

The way that you design APIs are different, JavaScript code and the lack of a type system leads to APIs being designed strictly for humans.

String as type identifier