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
#!/usr/bin/env bash | |
JDKS_DIR="/Library/Java/JavaVirtualMachines" | |
JDKS=( $(ls ${JDKS_DIR}) ) | |
JDKS_STATES=() | |
# Map state of JDK | |
for (( i = 0; i < ${#JDKS[@]}; i++ )); do | |
if [[ -f "${JDKS_DIR}/${JDKS[$i]}/Contents/Info.plist" ]]; then | |
JDKS_STATES[${i}]=enable |
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
// JS from https://johnathon.blog/how-to-use-zapier-extract-all-urls-from-text/ | |
// regex from dperini's adapted to JS & any matches https://mathiasbynens.be/demo/url-regex | |
var re_weburl = new RegExp(/\b((?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?)/) | |
output = inputData.rawBody.match(re_weburl) || []; | |
return output.map(function(url) { | |
return {url: url}; | |
}); |
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
SELECT | |
files.file_path, ref_commits.repository_id, files.blob_content | |
FROM | |
files | |
NATURAL JOIN | |
commit_files | |
NATURAL JOIN | |
ref_commits | |
WHERE | |
ref_commits.ref_name = 'HEAD' |
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
# (c) 2018 Marcelo Novaes | |
# License - MIT | |
# Enable AptX and AAC codecs on bluetooth connections on macOS | |
sudo defaults write bluetoothaudiod "Enable AptX codec" -bool true | |
sudo defaults write bluetoothaudiod "Enable AAC code" -bool true | |
# Reads set values, should return something like: | |
# { |
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
~/NVIDIA_CUDA-9.0_Samples/1_Utilities/deviceQuery > ./deviceQuery | |
./deviceQuery Starting... | |
CUDA Device Query (Runtime API) version (CUDART static linking) | |
Detected 1 CUDA Capable device(s) | |
Device 0: "GeForce GTX 1080 Ti" | |
CUDA Driver Version / Runtime Version 9.0 / 9.0 | |
CUDA Capability Major/Minor version number: 6.1 |
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
# Selects the right xcode for normal usage or CUDA usage | |
PS3='xcode version selector: ' | |
options=("Xcode latest (9.0)" "Xcode 8.3.3 (CUDA)" "Quit") | |
select opt in "${options[@]}" | |
do | |
case $opt in | |
"Xcode latest (9.0)") | |
echo "you chose: Xcode latest (9.0)" |