Instantly share code, notes, and snippets.

View scaleLinearlyBase.scss
/**
* Given a length value as seen in a mockup with a mobile-sized viewport
* and another length value seen in a wider mockup version, this mixin maps
* them into algebraic points and solves the linear interpolation,
* returning a calc function representing that solution. By default
* it will also automatically add an upper boundary to the length
* (with a breakpoint at the large viewport size provided).
*
* Example:
*
View debounce.js
/**
* Debounces (postpones) executing `func` until _at least_ `msWait` seconds have elapsed
* since the last time the same function had again been requested to execute.
*
* Example:
* const repaintElem = setRandomBgColorToElem(elem);
* document.addEventListener('resize', debounce(repaintElem, 10, true));
*
* @param {function} func The function to be debounced
* @param {number} [msWait=50] The minimum amount of time in miliseconds to wait before executing `func`
View optimalWoodCut.js
// CONSTANTS
// =====================
const a = 210; // length of a possible cut
const b = 156; // length of another possible cut
const c = 138; // length of another possible cut
const K = 590; // length of the wood plank to be cut in pieces of the above lengths
View heapSort-people-by-age.js
/* ------ Input Data ---------------------------*/
let people = [
{
"age": 34,
"name": "Malone Warren"
},
{
"age": 50,
View tslint.json
{
"rules": {
"no-any": true,
"no-duplicate-variable": true,
"class-name": true,
"max-classes-per-file": [true, 1],
"curly": true,
"only-arrow-functions": [true, "allow-declarations"],
"arrow-parens": true,
"adjacent-overload-signatures": true,
View cloudSettings
{"lastUpload":"2018-11-15T13:06:07.831Z","extensionVersion":"v3.2.0"}
View (vscode.keyboard-shortcuts)
// Place your key bindings in this file to overwrite the defaults
[
{ "key": "ctrl+shift+alt+/", "command": "workbench.action.terminal.kill" },
{ "key": "ctrl+shift+.", "command": "workbench.action.terminal.focusNext" },
{ "key": "ctrl+shift+,", "command": "workbench.action.terminal.focusPrevious" },
{ "key": "ctrl+shift+/", "command": "workbench.action.toggleMaximizedPanel" },
{ "key": "ctrl+q", "command": "workbench.action.openView" }
]
View .gitconfig
[user]
email = your@email.com
name = Dude Coder
# delete section if you don't use meld. Everyone's wierd in some way, I don't judge.
[merge]
tool = meld
[branch]
autosetuprebase = always
View COMMIT_GUIDELINES.md

Git Commit Guidelines

We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history. But also, we use the git commit messages to automatically generate the change log.

Commit Message Format

Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject: