Skip to content

Instantly share code, notes, and snippets.

View bearfighting's full-sized avatar

Florent Xing bearfighting

  • Montreal, Canada
View GitHub Profile
@b-adams
b-adams / 101020-arguments_fail1.pep
Created July 29, 2012 13:10
Example Pep/8 Programs
;Trying to use a global variable to allow function arguments
BR main
usrInput: .BLOCK 2 ;global variable #2d
showChar: NOP0
charo '\n',i
deco usrInput,d
RET0
@mzimecki
mzimecki / MergeSort.scala
Created October 16, 2013 09:20
[Scala] Merge sort with implicit parameter used for comparing elements in a list. Making prameter implicit will cause compiler will discover type of elements in a list to be sorted.
object MergeSort {
def msort[T](xs: List[T])(implicit ord: Ordering[T]): List[T] = {
def merge(xs: List[T], ys: List[T]): List[T] = (xs, ys) match {
case (Nil, ys) => ys
case (xs, Nil) => xs
case (x :: xs1, y :: ys1) =>
if (ord.lt(x, y)) x :: merge(xs1, ys) else y :: merge(xs, ys1)
}
@fxg42
fxg42 / flow-4.png
Last active September 9, 2021 19:01
8 implementations of the same pipeline in JavaScript
flow-4.png
@cdiggins
cdiggins / react-best-practices.md
Created January 25, 2018 16:20
React Best Practices
@fxg42
fxg42 / github-mvc-es209.js
Created July 17, 2019 15:39
INF5190 - Exemple d'une application MVC
class Model {
constructor() {
this.userCollection = [ ]
this.selectedUser = null
this.listeners = {
'selectedUser': [ ],
'userCollection': [ ]
}
}