Skip to content

Instantly share code, notes, and snippets.

View alizdavoodi's full-sized avatar

Alireza Davoodi alizdavoodi

  • Sympower
  • Netherlands
View GitHub Profile
### Keybase proof
I hereby claim:
* I am alirezadavid on github.
* I am alizdavoodi (https://keybase.io/alizdavoodi) on keybase.
* I have a public key ASBtTMTh58Gizgo5iGpangXqY7Fmqnrwb607vxDdYQtPngo
To claim this, I am signing this object:
@alizdavoodi
alizdavoodi / do_boot2.sh
Created May 26, 2017 12:54 — forked from leucos/do_boot2.sh
Bootstrap your DO infrastructure unsing Ansible without dynamic inventory (version for Ansible v2.0+ and DO API v2.0)
#!/bin/bash
#
# What is that
# ============
#
# This script will help you setting up your digital ocean
# infrastructure with Ansible v2.0+ and DO API v2
#
# Usually, when working with DO, one is supposed to use digital_ocean.py
# inventory file, and spin up instances in a playbook.

Keybase proof

I hereby claim:

  • I am alirezaDavid on github.
  • I am alirezadavid (https://keybase.io/alirezadavid) on keybase.
  • I have a public key whose fingerprint is 56C5 6A70 B46E F748 6582 F97E 8205 6775 C5F5 415F

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am alirezaDavid on github.
* I am alirezadavid (https://keybase.io/alirezadavid) on keybase.
* I have a public key whose fingerprint is 106B F512 CBEE 9835 1731 79F4 8A65 05A2 BA3E 4C92
To claim this, I am signing this object:
@alizdavoodi
alizdavoodi / defaultArguments.js
Last active December 11, 2021 11:21
It takes a function as an argument, along with an object containing default values for that function's arguments, and returns another function which defaults to the right values.
/* Some example which works for below func! */
function add(a,b) { return a+b;};
var add_ = defaultArguments(add,{b:9});
add_(10); // returns 19
add_(10,7); // returns 17
add_(); // returns NaN
add_ = defaultArguments(add_,{b:3, a:2});