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 calc({ | |
balance, | |
months, | |
percent, | |
cashbackPercent, | |
earnings, | |
spendings | |
}){ | |
let totalIncome = 0; | |
let credit = 0; |
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
ls | xargs |
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
pactl -- set-sink-volume 0 150% | |
0 - number of device(may be 1) |
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
grep -rnw '/path/to/somewhere/' -e "pattern" | |
-r or -R is recursive, | |
-n is line number, and | |
-w stands match the whole word. | |
-l (lower-case L) can be added to just give the file name of matching files. | |
Along with these, --exclude or --include parameter could be used for efficient searching. Something like below: | |
grep --include=\*.{c,h} -rnw '/path/to/somewhere/' -e "pattern" | |
This will only search through the files which have .c or .h extensions. Similarly a sample use of --exclude: | |
grep --exclude=*.o -rnw '/path/to/somewhere/' -e "pattern" |
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
find public/js/* | xargs -I file ./node_modules/.bin/uglifyjs file -c -o file | |
//"uglify:js": "find public/js/* | xargs -I file uglifyjs file -c -o file" |
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
#========================================================== | |
# Environment/Configuration | |
#========================================================== | |
# For project consistency, its better to depend on npm binaries loaded locally than | |
# globally, so we add .node_modules/.bin to the path for shorthand references. This | |
# means you should add any binaries you need to "devDependencies" in package.json. | |
export PATH := ./node_modules/.bin/:$(PATH) | |
# Pull in the name and version from package.json. The name will default to "app" if not set. |
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
def fibonacci(n): | |
foo = bar = 0 | |
for _ in range(n - 1): | |
# print foo, bar | |
if foo == 0: | |
foo = foo + 1 | |
continue | |
foo, bar = [foo + bar, foo] | |
return foo; |
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
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent http://example.org | |
--mirror – Makes (among other things) the download recursive. | |
--convert-links – convert all the links (also to stuff like CSS stylesheets) to relative, so it will be suitable for offline viewing. | |
--adjust-extension – Adds suitable extensions to filenames (html or css) depending on their content-type. | |
--page-requisites – Download things like CSS style-sheets and images required to properly display the page offline. | |
--no-parent – When recursing do not ascend to the parent directory. It useful for restricting the download to only a portion of the site. | |
-e robots=off - Ignore robots.txt rules | |
wget -mkEpnp -e robots=off http://example.org |
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
let foo, bar, firstMethod, secondMethod; | |
foo = []; | |
foo.push({ value: 'ua', long: 'Ukraine' }); | |
foo.push({ value: 'en', long: 'USA' }); | |
foo.push({ value: 'uk', long: 'United Kingom' }); | |
foo.push({ value: 'ca', long: 'Canada' }); | |
foo.push({ value: 'de', long: 'Germany' }); | |
bar = []; |