- Copy this Zap into your Zapier account and connect your Slack account: https://zapier.com/shared/532ac667d67cd8fceefccc83cc2169488679056d
- Copy both files above into your Mac's
$HOME/Library/LaunchAgents
- Replace the hoook URL in
slackstatus.sh
with the hook URL you get from Zapier, and replace [OFFICE NETWORK SSID] with your office's network SSID. Also update status emojis and text as you see fit - Replace [USERNAME] in
local.slackstatus.plist
with your user account name - Run
launchctl load -w ~/Library/LaunchAgents/local.slackstatus.plist
- ???
- Profit
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
#EAEAEA,#CBCCCF,#0E9DD3,#2FA659 |
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
# declare my US locale | |
defaults write NSGlobalDomain AppleLocale -string "en_US@currency=EUR" | |
defaults write com.apple.systempreferences AppleIntlCustomFormat -dict-add "AppleIntlCustomLocale" "en_US" | |
# date string formats | |
defaults write NSGlobalDomain AppleICUDateFormatStrings -dict-add "1" "dd.MM.yy" | |
defaults write NSGlobalDomain AppleICUDateFormatStrings -dict-add "2" "dd MMM yy" | |
defaults write NSGlobalDomain AppleICUDateFormatStrings -dict-add "3" "dd MMMM yy" | |
defaults write NSGlobalDomain AppleICUDateFormatStrings -dict-add "4" "EEEE, dd MMMM y" |
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 python3 | |
import os | |
import subprocess | |
import tempfile | |
import sys | |
import shutil | |
import glob | |
import requests | |
from datetime import datetime |
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 python3 | |
""" | |
Automatically setup external monitors at MOIA so that it's to the right of the | |
internal screen | |
Prerequisite: [displayplacer](https://github.com/jakehilborn/displayplacer) | |
```bash | |
brew tap jakehilborn/jakehilborn && brew install displayplacer | |
``` |
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 | |
stash() { | |
# check if we have uncommited changes to stash | |
git status --porcelain | grep "^." >/dev/null; | |
if [ $? -eq 0 ] | |
then | |
if git stash save -u "git-update on `date`"; | |
then |
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 python3 | |
import sys | |
import os | |
import csv | |
import xlsxwriter # pip3 install xlsxwriter | |
from typing import List | |
def convert_row(row: List[str]) -> List[str]: | |
row[3] = convert_gender(row[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
#!/bin/bash | |
DOMAIN="example.tld" | |
certbot certonly -n --preferred-challenges dns --manual --manual-public-ip-logging-ok --manual-auth-hook /usr/local/bin/tinydns-certbot-enable --manual-cleanup-hook /usr/local/bin/tinydns-certbot-disable -d $DOMAIN -d \*.$DOMAIN |
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 -e | |
apt install -y ucspi-tcp build-essential | |
wget http://cr.yp.to/djbdns/djbdns-1.05.tar.gz | |
tar xf djbdns-1.05.tar.gz | |
cd djbdns-1.05/ | |
echo gcc -O2 -include /usr/include/errno.h > conf-cc | |
wget https://www.fefe.de/dns/djbdns-1.05-test28.diff.xz | |
xz -d djbdns-1.05-test28.diff.xz |
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
func makeGetCall() { | |
// Set up the URL request | |
let todoEndpoint: String = "https://jsonplaceholder.typicode.com/todos/1" | |
guard let url = URL(string: todoEndpoint) else { | |
print("Error: cannot create URL") | |
return | |
} | |
let urlRequest = URLRequest(url: url) | |
// set up the session |
NewerOlder