Skip to content

Instantly share code, notes, and snippets.

Kostis Maninakis maninak

View GitHub Profile
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`
@maninak
maninak / optimalWoodCut.js
Last active Jul 22, 2017
Wanted to cut planks of wood. The size of the possible cuts was fixed. Wanted to utilize as much of the wooden planks as possible. Like a true engineer, I took this to the editor :P .
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
@maninak
maninak / heapSort-people-by-age.js
Created Jul 7, 2017
A javascript implementation of Heap Sort algorithm that sorts an array of objects {age: number, string: name} in ascending order of age.
View heapSort-people-by-age.js
/* ------ Input Data ---------------------------*/
let people = [
{
"age": 34,
"name": "Malone Warren"
},
{
"age": 50,
@maninak
maninak / tslint.json
Created Jun 4, 2017
An opinionated TSLint configuration to keep you and your team sane while working on Typescript projects.
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,
@maninak
maninak / cloudSettings
Last active Feb 21, 2019
Visual Studio Code Sync Settings GIST
View cloudSettings
{"lastUpload":"2019-02-21T10:29:35.881Z","extensionVersion":"v3.2.5"}
@maninak
maninak / (vscode.keyboard-shortcuts)
Last active Dec 27, 2016
Nifty Visual Studio Code settings I use for my projects.You can use `vscode.workspace` to enforce best practices or `vscode.user` to get best practices + the misc vscode settings I personally use. You can install them by copy-pasting them under File -> Preferences.
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" }
]
@maninak
maninak / .gitconfig
Last active Mar 2, 2019
(edit as needed and) Place this file in your home folder (e.g.: /home/maninak/.gitconfig). Learn more: https://medium.com/@maninak/git-fancy-with-your-version-control-a3a895d1dede
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
@maninak
maninak / COMMIT_GUIDELINES.md
Created Dec 11, 2016
A file with commit message guidelines following the Angular convention. Feel free to copy and paste in your project's root folder as is, or start with it as a template and modify it to your needs.
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:

You can’t perform that action at this time.