This file contains 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
Section "InputClass" | |
Identifier "libinput touchpad catchall" | |
MatchIsTouchpad "on" | |
MatchDevicePath "/dev/input/event*" | |
Driver "mtrack" | |
#Option "Ignore" "on" | |
Option "IgnorePalm" "true" | |
Option "TapButton1" "1" | |
Option "TapButton2" "3" |
This file contains 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 ( | |
fmt | |
) | |
func main() { | |
type fnType = func(a int, b int) int | |
fnMap := map[string]fnType{ | |
"ADD": func(a int, b int) int { |
This file contains 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 | |
set -e | |
export distribution=$(. /etc/os-release;echo $ID$VERSION_ID) | |
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | apt-key add - | |
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | tee /etc/apt/sources.list.d/nvidia-docker.list | |
# Because of Microsoft not properly installing cuda :/ |
This file contains 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
# Source ACR | |
repositories=$(az acr repository list -n <sourceACRName>) | |
for r in $repositories; do az acr repository show-manifests -n <sourceACRName> --repository $r ; done | |
cat response.json | jq -r '.[].tags[0]' | grep -v null | xargs -n 1 -I % sh -c "az acr import -n <sourceACRName> --source $REPO:% --image $REPO:% --registry <scopeId>" |
This file contains 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 | |
set -e | |
rm -rf /var/lib/apt/lists/* | |
apt-get update | |
apt-cache gencaches | |
apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ |
This file contains 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 | |
set -e | |
apt-get update | |
apt-get install -y \ | |
ca-certificates \ | |
curl \ | |
apt-transport-https \ | |
lsb-release \ |
This file contains 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
const swap = ([first, second]) => [second, first]; | |
console.log( swap([1, 2]) ); // [2, 1] | |
const rotate = ([first, ...rest]) => [...rest, first]; | |
console.log( rotate([1, 2, 3]) ); // [2, 3, 1] | |
const arrToObj = ([key, value]) => ({ [key]: value }); | |
console.log( arrToObj([ 'foo', 'bar' ]) ); // { "foo": "bar" } | |
const createUser = ({ |
This file contains 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 | |
set -Eeuo pipefail | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
usage() { | |
cat <<EOF | |
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
This file contains 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
//Summing an Array of Numeric Properties | |
const lineItems = [ | |
{ description: 'Eggs (Dozen)', quantity: 1, price: 3, total: 3 }, | |
{ description: 'Cheese', quantity: 0.5, price: 5, total: 2.5 }, | |
{ description: 'Butter', quantity: 2, price: 6, total: 12 } | |
] | |
const sumReducer = (sum, val) => sum + val | |
lineItems.map(li => li.total).reduce(sumReducer, 0) |
This file contains 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
//String + Date Format | |
const datePattern = /^(\d{2})-(\d{2})-(\d{4})$/ | |
const [, month, day, year] = datePattern.exec('12-25-1995') | |
new Date(`${month}, ${day} ${year}`) | |
// => "1995-12-24T13:00:00.000Z" | |
//String + Time Format |
OlderNewer