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
type JobReact struct { | |
name string | |
Duration time.Duration | |
Info interface{} | |
Error error | |
} | |
func (m *JobReact) Name() string { | |
return m.name | |
} |
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
package main | |
/** | |
* Each worker calculates fibonacci sequence for N int in order to show how worker pools can be utilized. | |
* | |
* Instructions: | |
* UNCOMMENT `DemoCreateSingleWorker()` OR `DemoCreateOneWorkerPerCPUCore()` | |
* FOR BEST RESULTS, ONLY UNCOMMENT ONE AT A TIME | |
* | |
* BE WARNED THIS CAN GET PRETTY INTENSE ON YOUR CPU AFTER LIKE 2 MIN |
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
package main | |
import ( | |
"errors" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"os" | |
"strings" |
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
# Credit to https://www.youtube.com/watch?v=o_PnB7bHhA0 | |
# create raid based upon drives | |
sudo mdadm --create /dev/md1 --level=1 --raid-devices=4 /dev/sd[a-d] | |
# list drives | |
lsblk | |
# get status of raid setup | |
# CHANGE md0 TO WHATEVER YOU WANT TO CALL THE PARTITION |
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
#!/bin/bash | |
# | |
# Use like: | |
# ./this-script.sh --container_name yourcontainername | |
# | |
printf '%s\n' "[NOTE] We assume you have a 'Dockerfile' at the root of this project" | |
container_name=${container_name:-} |
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
#!/bin/bash | |
curl -LO "https://storage.googleapis.com/kubernetes-release/release/v1.19.0-rc.1/bin/linux/amd64/kubectl" | |
chmod +x ./kubectl | |
sudo mv ./kubectl /usr/local/bin/kubectl | |
kubectl version --client --short |
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
# -------------------------------------- # | |
# ------------- How to use ------------- # | |
# -------------------------------------- # | |
# 1) Run: docker-compose up -d | |
# 2) Go to: http://localhost:15672 | |
# 3) Default Creds: guest/guest` (obviously, this is if you don't use the `environment` vars below) | |
# rabbitmq port list at EOF | |
version: "3.7" |
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
// https://flaviocopes.com/javascript-property-descriptors/ | |
const js_standard_property_descriptors_and_definitions = { | |
value: "the value of the property", | |
writable: "true the property can be changed", | |
configurable: "if false, the property cannot be removed nor any attribute can be changed, except its value", | |
enumerable: "true if the property is enumerable", | |
get: "a getter function for the property, called when the property is read", | |
set: "a setter function for the property, called when the property is set to a value", | |
}; |
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
#!/bin/bash | |
sudo rm -rf $(xcode-select -print-path) | |
xcode-select --install |
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
/** | |
* @plug | |
* DOMRegex.js | |
* https://mattoestreich.com | |
* | |
* @description | |
* Modified from: https://stackoverflow.com/a/62144522 | |
* TLDR; querySelectorAll with regex support | |
* | |
* @important |