Skip to content

Instantly share code, notes, and snippets.

View Cmdv's full-sized avatar
🤷‍♂️
¯\_(ツ)_/¯

Vincent Orr Cmdv

🤷‍♂️
¯\_(ツ)_/¯
View GitHub Profile
@Cmdv
Cmdv / 0_reuse_code.js
Last active August 29, 2015 14:20
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
@Cmdv
Cmdv / thisKeyword.js
Last active September 13, 2015 18:14
// ---------- Default Binding ---------
//
function aFoo(){
console.log(this.aBar); // this is undefinied or global unless in strict mode
}
var aBar = "Default bar1";
aFoo(); // default binding rule
var a_o2 = {aBar: "Default bar2", aFoo: aFoo};
var a_o3 = {aBar: "Default bar3", aFoo: aFoo};
a_o2.aFoo(); a_o2.aFoo(); // implicit binding rule
import Cycle from '@cycle/core'; // the core Cycle
import {h, makeDOMDriver} from '@cycle/dom'; // this is a side effect driver
import Rx from 'rx'; // RxJS
function main({DOM}) { // our Cycle app, it's simple a function
const DEFAULT_VALUE = 50; // a default config
// we select and watch our slider input from the DOM which is comes in via our function definition
// these avents are turned into Rx streams
let changeValue$ = DOM.select('#slider').events('input')
@Cmdv
Cmdv / reactive-programming-cycle-js.md
Last active October 6, 2019 07:28
Reactive Programming & Cycle.js list of learning material
@Cmdv
Cmdv / esnextbin.md
Created April 5, 2016 09:36
esnextbin sketch
@Cmdv
Cmdv / most.md
Last active April 12, 2016 14:16
                                          ,d     
                                          88     

88,dPYba,,adPYba, ,adPPYba, ,adPPYba, MM88MMM
88P' "88" "8a a8" "8a I8[ "" 88
88 88 88 8b d8 "Y8ba, 88 88 88 88 "8a, ,a8" aa ]8I 88, 88 88 88 "YbbdP"' `"YbbdP"' "Y888

o o o-o o-o o-O-o

function map (toSomething, obj) {
const newObj = {}
const keys = Object.keys(obj)
for (let i = 0; i < keys.length; ++i) {
const name = keys[i]
newObject[name] = toSomething(obj[name])
}
return newObj
}
@Cmdv
Cmdv / nested.hs
Last active November 2, 2018 11:48
Flatten a nested List of any given depth into a single level deep list.
module NestedListExercise where
import Test.QuickCheck
import Test.QuickCheck.Monadic
-------------------------------------------------------------------------------
-- ** Implemetation
-------------------------------------------------------------------------------
-- I wanted to do this little test using Haskell due to the type safety and how
-- we can randomly generate different nested lists to tests against our implementation.
@Cmdv
Cmdv / .spacemacs
Created June 14, 2019 10:06
Spacemacs Haskell Stack
;; -*- mode: emacs-lisp; lexical-binding: t -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Layer configuration:
This function should only modify configuration layer settings."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;; `+distribution'. For now available distributions are `spacemacs-base'
@Cmdv
Cmdv / .spacemacs
Created October 30, 2019 21:26
spacemacs setting 2019
;; -*- mode: emacs-lisp; lexical-binding: t -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Layer configuration:
This function should only modify configuration layer settings."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;; `+distribution'. For now available distributions are `spacemacs-base'