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
gist |
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
sudo reflector --verbose -l 200 -p http --sort rate --save /etc/pacman.d/mirrorlist |
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
date -s "$(wget -S "http://www.google.com/" 2>&1 | grep -E '^[[:space:]]*[dD]ate:' | sed 's/^[[:space:]]*[dD]ate:[[:space:]]*//' | head -1l | awk '{print $1, $3, $2, $5 ,"GMT", $4 }' | sed 's/,//')" |
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 | |
pygmentize $1 | less -R -N |
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
# | |
# ~/.bashrc | |
# | |
# If not running interactively, don't do anything | |
[[ $- != *i* ]] && return | |
# improve the path | |
if [ -d "$HOME/bin" ] ; then | |
PATH="$HOME/bin:$PATH" |
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
gcloud beta pubsub topics publish cron-5-minutes --message="run cron" |
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
gcloud beta functions deploy my-cloud-function --source=https://source.developers.google.com/projects/${PROJECT}/repos/${SOURCE_REPO}/fixed-aliases/${GIT_TAG} |
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
apiVersion: batch/v1beta1 | |
kind: CronJob | |
metadata: | |
name: every-5-minutes | |
spec: | |
schedule: "*/5 * * * *" | |
jobTemplate: | |
spec: | |
template: | |
spec: |
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
// Create a private instance of lodash | |
// since we will modify the memoize cache config | |
const {memoize} = require('lodash').runInContext(); | |
// Set the memoize cache to use WeakMap | |
memoize.Cache = WeakMap; |
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 getUserFromDatabase = memoize(async ctx => { | |
const { | |
req: { | |
headers: {Authorization: userCred}, | |
}, | |
} = ctx; | |
const user = await db.getUserByCredential(userCred); | |
return user; | |
}); |
OlderNewer