This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function asyncFunc(e) { | |
return new Promise((resolve, reject) => { | |
setTimeout(() => resolve(e), e * 1000); | |
}); | |
} | |
const arr = [1, 2, 3]; | |
function workMyCollection(arr, results = []) { | |
return new Promise((resolve, reject) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function asyncFunc(e) { | |
return new Promise((resolve, reject) => { | |
setTimeout(() => resolve(e), e * 1000); | |
}); | |
} | |
const arr = [1, 2, 3]; | |
let final = []; | |
function workMyCollection(arr) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for a in *.flac; do | |
ffmpeg -i "$a" -qscale:a 0 "${a[@]/%flac/mp3}" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For Windows | |
alias subl='/c/Program\ Files/Sublime\ Text\ 3/subl.exe' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* func - function to be called | |
* threshold - time period in milliseconds | |
* N - how many function calls will be allowed to execute | |
*/ | |
var debounceN = function(func, threshold, N) { | |
var counter = 0; | |
return function f() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* func - function you want to debounce | |
* wait - time period in milliseconds | |
* immediate - boolean if you want to execute function right away | |
*/ | |
function debounce(func, wait, immediate) { | |
var timeout; | |
return function() { | |
var context = this, args = arguments; | |
var later = function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First set your git config to push only current branch | |
# This will change default behaviour of your GIT push command | |
# instead of pushing all changed branches from your local repo to the remote | |
# it will push ONLY your CURRENT branch you are on to the remote | |
git config --global push.default simple | |
# Add this alias to your ~/.bash_profile (OSX, Linux) or ~/.bashrc (Windows + Git Bash) | |
vim ~/.bash_profile | |
# If you have not setup your branch to track remote one. CUR_BRANCH is the name of the branch you are working with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* MIT license | |
* 2015 Alexey Novak | |
* | |
* Inspired by http://youmightnotneedjquery.com/ with few of my own modifications | |
* | |
**/ | |
var deepExtend = function(out) { | |
out = out || {}; |
NewerOlder