I hereby claim:
- I am mahmoud-eskandari on github.
- I am mahmoud_etc (https://keybase.io/mahmoud_etc) on keybase.
- I have a public key whose fingerprint is E564 7797 34FB 957A E0DE D9B0 C63E FFE4 4AA0 7B64
To claim this, I am signing this object:
| package main | |
| import "fmt" | |
| func main() { | |
| fmt.Println(Factorial(65)) | |
| } | |
| func Factorial(n uint64) uint64 { | |
| factorialOp(&n, 1, n) |
I hereby claim:
To claim this, I am signing this object:
| function flattenMap(itemList, key) { | |
| return itemList.flatMap(item => { | |
| if (typeof item[key] === 'undefined' || item[key].length === 0) { | |
| return item; | |
| } | |
| let childs = item[key]; | |
| delete item[key]; | |
| return [item, ...flattenMap(childs, key)]; | |
| }); | |
| } |
| func EvalStr(str string, input map[string]string) string { | |
| for key := range input { | |
| re := regexp.MustCompile(`(?mU)\[` + key + `\](.*)\[/` + key + `\]`) | |
| for _, match := range re.FindAllString(str, -1) { | |
| if len(input[key]) > 0 { | |
| inner := strings.Replace(match, `[`+key+`]`, "", -1) | |
| inner = strings.Replace(inner, `[/`+key+`]`, "", -1) | |
| str = strings.Replace(str, match, inner, -1) | |
| } else { | |
| str = strings.Replace(str, match, "", 1) |
| sudo -i | |
| # example sda | |
| lsblk >> get list of partitions | |
| fdisk /dev/sda | |
| >> New Partition | |
| n |
| { | |
| "application/andrew-inset": [ | |
| "ez" | |
| ], | |
| "application/applixware": [ | |
| "aw" | |
| ], | |
| "application/atom+xml": [ | |
| "atom" | |
| ], |
| func NumberFormat(s string) (out string) { | |
| ln := len(s) | |
| mod := ln % 3 | |
| m := strings.Split(s, "") | |
| for k, v := range m { | |
| if (mod == 0 && k > 0 && k%3 == 0 && k < ln) || | |
| (mod > 0 && k >= (mod) && (k+(3-mod))%3 == 0 && k < ln) { | |
| out += "," | |
| } | |
| out += v |
| TIMESTAMP(DATE_SUB(CURDATE(),INTERVAL | |
| CASE weekday(CURDATE()) | |
| WHEN 0 THEN 2 | |
| WHEN 1 THEN 3 | |
| WHEN 2 THEN 4 | |
| WHEN 3 THEN 5 | |
| WHEN 4 THEN 6 | |
| WHEN 5 THEN 0 | |
| WHEN 6 THEN 1 | |
| END |
| curl -fsSL https://get.docker.com | sh | |
| curl -L "https://github.com/docker/compose/releases/download/$(curl --silent "https://api.github.com/repos/docker/compose/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
| chmod +x /usr/local/bin/docker-compose | |
| ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose |
| "use strict"; | |
| // By Mahmoud Eskandari @ MIT license | |
| function validateCard(card) { | |
| if (typeof card === 'undefined' | |
| || card === null | |
| || card.length !== 16) { | |
| return false; | |
| } | |
| let cardTotal = 0; | |
| for (let i = 0; i < 16; i += 1) { |