Skip to content

Instantly share code, notes, and snippets.

Avatar

Alireza Davoodi alirezaDavid

View GitHub Profile
@alirezaDavid
alirezaDavid / defaultArguments.js
Last active Aug 29, 2015
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.
View defaultArguments.js
/* 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});
View gist:9ad298014d2595c27d07
### 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:
View keybase.md

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:

@alirezaDavid
alirezaDavid / do_boot2.sh
Created May 26, 2017 — 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)
View do_boot2.sh
#!/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.
View gist:e99affb49fe2b4cf4f517150d4619a54
### 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: