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
const config = [ | |
{ | |
project: "erisa", | |
days: 180 | |
}, | |
{ | |
project: "super-secret-sauce", | |
days: 60 | |
} | |
] |
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
IF((values), | |
LEN( | |
IF( | |
FIND(",", ARRAYJOIN(ARRAYUNIQUE(values), ",")&"") = 1, | |
SUBSTITUTE(ARRAYJOIN(ARRAYUNIQUE(values), ",")&"", ",", "", 1), | |
IF( | |
FIND(",", ARRAYJOIN(ARRAYUNIQUE(values), ",")&"", LEN(ARRAYJOIN(ARRAYUNIQUE(values), ",")&"") - 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
echo '{"a":"aa", "b":"bb"}' | jq -r -s '. | (map(keys) | add | unique) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[]' |
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
# Description: Boxstarter Script | |
# Author: Jess Frazelle <[email protected]> | |
# Last Updated: 2017-09-11 | |
# | |
# Install boxstarter: | |
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force | |
# | |
# You might need to set: Set-ExecutionPolicy RemoteSigned | |
# | |
# Run this boxstarter by calling the following from an **elevated** command-prompt: |
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 python3 | |
import email.message | |
import mailbox | |
# Just ignore these lines. | |
# Python's mbox reader finds a way to return Messages that don't | |
# have these super-important methods. This hack adds them. | |
setattr(email.message.Message, '_find_body', email.message.MIMEPart._find_body) | |
setattr(email.message.Message, '_body_types', email.message.MIMEPart._body_types) |
Setup:
# set CONTRIBUTORS file to mailmap to remove duplicate emails for the same name
# see: https://git-scm.com/docs/git-shortlog#_mapping_authors
$ git config mailmap.file CONTRIBUTORS
Top 10 contributors (all):
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
# Ask for the user password | |
# Script only works if sudo caches the password for a few minutes | |
sudo true | |
# Install kernel extra's to enable docker aufs support | |
# sudo apt-get -y install linux-image-extra-$(uname -r) | |
# Add Docker PPA and install latest version | |
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" |
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
function Send-MailgunEmail($from, $to, $subject, $body, $emaildomain, $apikey) { | |
$idpass = "api:$($apikey)" | |
$basicauth = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($idpass)) | |
$headers = @{ | |
Authorization = "Basic $basicauth" | |
} | |
$url = "https://api.mailgun.net/v2/$($emaildomain)/messages" | |
$body = @{ | |
from = $from; |
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 | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |
NewerOlder