Skip to content

Instantly share code, notes, and snippets.

@ifnull
ifnull / README.md
Created June 19, 2024 00:10
Watcher for PlantUML on MacOS

Install

brew install plantuml fswatch
# Download plantuml-watch.sh
chmod +x ./plantuml-watch.sh
mkdir -p /usr/local/bin
mv ./plantuml-watch.sh /usr/local/bin/plantuml-watch
# Confirm /usr/local/bin is in PATH or mv script to directory in PATH
echo $PATH
@ifnull
ifnull / balloons.txt
Created February 28, 2024 18:08
iMessage Trigger Phrases
ENGLISH - balloons
------------------
happy birthday
████████████████████████████████████████████████████
ARABIC - بالونات (balloons)
----------------------------
عيد ميلاد سعيد (happy birthday)
a ---------------------
à (grave)
á (acute)
â (circumflex)
ä (umlaut or diaeresis)
æ (ash or æsh) [a ligature or diphthong]
ã (tilde)
å (overring)
ā (macron)
ǎ (caron or hacek / háček / haček) iOS 17 and later only
@ifnull
ifnull / install_python.sh
Created April 10, 2023 18:43
Install Python on MacOS using Brew and pyenv
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install openssl readline sqlite3 xz zlib
brew install pyenv
pyenv install 3.11.3
pyenv global 3.11.3
pyenv version
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.zshrc
@ifnull
ifnull / post-merge
Last active November 1, 2021 17:35
Simple `git pull` Deployment Slack Notification
#!/bin/sh
# WARNING: Putting your git repo in your web root can be dangerous.
SLACK_WEBHOOK_URL=$(git config --get hooks.slack.deploy-webhook-url)
SLACK_USERNAME="Git Deploy Bot (Develop)"
REPO_PATH="$(dirname ${BASH_SOURCE[0]})/.."
GIT_ORIG_HEAD=$(git rev-parse ORIG_HEAD | awk '{print $1}')
GIT_HEAD=$(git rev-parse HEAD | awk '{print $1}')
@ifnull
ifnull / wc-delete-all-products.sh
Created October 26, 2021 18:51
Woocommerce - Fast bulk delete all products, product variants, product post meta, product terms, and product relationships
#!/bin/sh
wp --user=1 db import ./wc-delete-all-products.sql
wp --user=1 wc tool run regenerate_product_lookup_tables
@ifnull
ifnull / check_ssl.sh
Created May 6, 2021 19:40
Check SSL cert of localhost virtual host by forcing / overriding the server name.
# Solution 1
echo | openssl s_client -showcerts -servername example.com -connect 127.0.0.1:443 2>/dev/null | openssl x509 -inform pem -noout -text
# Solution 2
curl --insecure --resolve example.com:443:127.0.0.1 -vvI https://example.com 2>&1 | awk 'BEGIN { cert=0 } /^\* SSL connection/ { cert=1 } /^\*/ { if (cert) print }'
@ifnull
ifnull / main.py
Created February 13, 2021 23:31
MIT xPRO: DSx Data Science and Big Data Analytics: Making Data-Driven Decisions - Case Study 3.2
import matplotlib.pyplot as plt
import numpy as np
def plot_dataset(x, y, legend_loc='lower left'):
fig, ax = plt.subplots()
ax.scatter(
x[y == 1, 0],
x[y == 1, 1],
@ifnull
ifnull / main.py
Last active February 10, 2021 06:26
MIT xPRO: DSx Data Science and Big Data Analytics: Making Data-Driven Decisions - Challenger Case Study
import numpy as np
import statsmodels.discrete.discrete_model as sm
import matplotlib as mpl
import pandas as pd
from patsy import dmatrices
from matplotlib import pyplot as plt
data = pd.read_csv("challenger-data.csv")
@ifnull
ifnull / news_dataset_download.py
Last active February 2, 2021 21:42
MIT xPRO: DSx Data Science and Big Data Analytics: Making Data-Driven Decisions - News Downloader
import os
import requests
from datetime import datetime, timedelta
from newsapi import NewsApiClient
from bs4 import BeautifulSoup
# Configurations
newsapi = NewsApiClient(api_key='****')
output_path = './corpus/'