Skip to content

Instantly share code, notes, and snippets.

View rubystream's full-sized avatar

Dejan Dimic rubystream

View GitHub Profile
@rubystream
rubystream / ort-docker-how-to.md
Last active November 13, 2021 20:48
Using ort - Docker vesion

How-To ort the Docker way

Purpose of this document is to provide instruction on how to create docker image for convenient way of running ORT tool in order to assess license compliance of project license compliance.

Creating the Docker image

To create the Docker image first the ORT project follow these steps:

  1. Clone ORT project to local folder
@rubystream
rubystream / free-web-development-resources.md
Last active April 24, 2021 20:25
FREE And Useful Resources for Web Development

FREE And Useful Resources for Web Development

  • freehtml5 - Free & Premium HTML5 Bootstrap Templates
  • https://pixabay.com/ - free images & royalty free stock
  • coolors - The super fast color schemes generator!
  • uigradients - A handpicked collection of beautiful color gradients
  • shadeswash - find the right shade of a color
  • flaticon - The largest database of free customizable icons in the world
  • favicon - tool to generate favicon
@rubystream
rubystream / script-template.sh
Created December 29, 2020 09:51 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@rubystream
rubystream / .tmux.conf
Last active October 26, 2018 18:04
My tmux.conf
# Unbind C-b as the default prefix
unbind C-b
# Set new default prefix
set-option -g prefix `
set -g default-terminal "screen-256color"
set -g default-shell $SHELL
set -g default-command "reattach-to-user-namespace -l ${SHELL}"

Setup Terminal on MacBook pro

You will need Powerline fonts that you can install from here https://github.com/powerline/fonts. Afterwards you should update your fonts in iTerm2.

iTerm2

brew cask install iterm2
@rubystream
rubystream / DockerCheatSheer.md
Created September 16, 2018 10:52
A Docker Cheat Sheet

A Docker Cheat Sheet

Purging All Unused or Dangling Images, Containers, Volumes, and Networks

docker system prune

To remove any stopped containers and all unused images (not just dangling images), add the -a flag to the command:

@rubystream
rubystream / Promise waterfall.js
Created October 3, 2016 08:45
Promise waterfall
// objectsToProcess - array of objects to process
// asyncFunction - asynct function that take objectsToProcess item as argument and return a promise
var promise = objectsToProcess.reduce((accumulator , item) => {
return accumulator.then(asyncFunction(item));
}, Promise.resolve());
promise
.then(console.log)
.catch(console.log);
@rubystream
rubystream / Promise.race.timeout.js
Created October 2, 2016 21:16
Promise.race timeout
function delay(time) {
return new Promise(fulfill => {
setTimeout(fulfill, time);
});
}
Promise.race([longRunningPromise, delay(time).then(function () {
throw new Error('Operation timed out');
})])
.then(value => { console.log(value); })
@rubystream
rubystream / Promise.all reduce.js
Last active May 30, 2018 19:32
Promise.all reduce
Promise.all(objectsToProcess.reduce((sum, item) => {
if (item && item.shouldProcess) {
sum.push(asyncFunction(item));
}
return sum;
}, []))
.then(values => { console.log(values); })
.catch(reason => { console.log(reason); });
@rubystream
rubystream / Promise.all vanila.js
Created October 2, 2016 08:10
Promise.all vanila
// objectsToProcess - array of objects to process
// asyncFunction - asynct function that take objectsToProcess item as argument and return a promise
Promise.all(objectsToProcess.map(asyncFunction))
.then(values => { console.log(values) })
.catch(reason => { console.log(reason) });