Skip to content

Instantly share code, notes, and snippets.

View jaunkst's full-sized avatar

Jason Aunkst jaunkst

View GitHub Profile
@jaunkst
jaunkst / bfs.js
Created June 16, 2020 18:10
FE Algorithms
/**
* Definition for a binary tree node.
* function TreeNode(val) {
* this.val = val;
* this.left = this.right = null;
* }
*/
export function TreeNode(val) {
this.val = val;
@jaunkst
jaunkst / quick-sort.js
Created June 16, 2020 18:06
quick-sort.js
function quickSort(arr) {
if(arr.length < 2) return arr;
const pivot = arr[0];
const left = [];
const right = [];
for(i=1;i<arr.length;i++){
arr[i] < pivot ? left.push(arr[i]) : right.push(arr[i]);
}

A Basic Introduction

Pure Functions (x → y)

A pure function takes in arguments and returns values, uses no hidden state, has no side effects, is referentially transparent, easy to reason, and test.

Functional Programming

The functional programming paradigm was explicitly created to support a pure functional approach to problem solving. Functional programming is a form of declarative programming. In contrast, most mainstream languages, including object-oriented programming (OOP) languages such as C#, Visual Basic, C++, and Java, were designed to primarily support imperative programming.

Imperative programming gives rise to a lot of the constructs we use every day: control flow (if-then-else statements and loops), arithmetic operators (+, -, *, /), comparison operators (===, >, <, etc.), and logical operators (&&, ||, !).

@jaunkst
jaunkst / blokkr.schema.json
Created July 1, 2019 23:35
blokkr.schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"packs": {
"type": "object",
"properties": {
"behaviorPack": {
"properties": {
"name": {
"type": "string"

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
<todo>
<h3>TODO</h3>
<ul>
<li each={ item, i in items }>{ item }</li>
</ul>
<form onsubmit={ handleSubmit }>
<input>
<button>Add #{ items.length + 1 }</button>
# CSS
.red{
background:red;
padding: 20px;
.box{
width:100px;
height:100px;
background:yellow;
}
}
@jaunkst
jaunkst / gist:6551840
Created September 13, 2013 14:59
console.log(hello) lol.
[][(not [] + [])[+[[+[]]]] + ([][[]] + [])[+[[not +[] + not +[] + not +[] + not +[] + not +[]]]] + (not [] + [])[+[[not +[] + not +[]]]] + (!![] + [])[+[[+[]]]] + (!![] + [])[+[[not +[] + not +[] + not +[]]]] + (!![] + [])[+[[+not +[]]]]][([][(not [] + [])[+[[+[]]]] + ([][[]] + [])[+[[not +[] + not +[] + not +[] + not +[] + not +[]]]] + (not [] + [])[+[[not +[] + not +[]]]] + (!![] + [])[+[[+[]]]] + (!![] + [])[+[[not +[] + not +[] + not +[]]]] + (!![] + [])[+[[+not +[]]]]] + [])[+[[not +[] + not +[] + not +[]]]] + ([][(not [] + [])[+[[+[]]]] + ([][[]] + [])[+[[not +[] + not +[] + not +[] + not +[] + not +[]]]] + (not [] + [])[+[[not +[] + not +[]]]] + (!![] + [])[+[[+[]]]] + (!![] + [])[+[[not +[] + not +[] + not +[]]]] + (!![] + [])[+[[+not +[]]]]] + [])[+[[not +[] + not +[] + not +[] + not +[] + not +[] + not +[]]]] + ([][[]] + [])[+[[+not +[]]]] + (not [] + [])[+[[not +[] + not +[] + not +[]]]] + (!![] + [])[+[[+[]]]] + (!![] + [])[+[[+not +[]]]] + ([][[]] + [])[+[[+[]]]] + ([][(not [] + [])[+[[+[]]]] + (