Skip to content

Instantly share code, notes, and snippets.

View slurpyb's full-sized avatar

Jordan slurpyb

  • Perth, Western Australia
  • 04:34 (UTC +08:00)
View GitHub Profile
#!/bin/zsh
# CREDIT: https://www.reddit.com/r/git/comments/wgyn0j/comment/ij31p2c/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
# Given a github repo URL, clones the repo in ~/src/<year>/<user>/<repo>
set -eu
repo="$(echo "$1" | sed -r -e 's|https?://github.com/([^/]+)/([^/]+).*|\1/\2|')"
year="$(date +%Y)"
cd ~/src/$year/
mkdir -p "$repo"
cd "$repo"
pwd
@slurpyb
slurpyb / meta-tags.md
Created July 4, 2024 03:56 — forked from whitingx/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@slurpyb
slurpyb / hydrawise_sensors.yaml
Last active December 15, 2022 15:52
hydrawise_sensors.yaml
# https://support.hydrawise.com/hc/en-us/article_attachments/360058265154/Hydrawise_REST_API.pdf
# configuration.yaml
rest:
- resource: https://api.hydrawise.com/api/v1/statusschedule.php?api_key=YOUR_API_KEY
scan_interval: 60
method: GET
sensor:
- name: "Hydrawise Relay 1"
unique_id: rest_hydrawise_relay_1
json_attributes_path: "$.relays[0]"
@slurpyb
slurpyb / nginx_letsencrypt_block.sh
Last active December 10, 2022 03:15
Nginx LetsEncrypt Server Block Gen
#!/bin/sh
# https://www.nginx.com/blog/using-free-ssltls-certificates-from-lets-encrypt-with-nginx/
echo "Nginx LetsEncrypt SSL/TLS Config Generator!"; echo "Please enter desired domain ie foo.bar.com, example.com"
read -r domain
echo "Creating Nginx server configuration file for $domain"
echo "server {
listen 80;
listen [::]:80;
root /var/www/html/$domain;
@slurpyb
slurpyb / scoped_flags.hpp
Created May 27, 2022 15:43 — forked from ltjax/scoped_flags.hpp
scoped_flags for c++11 scoped enumerations
#pragma once
template <class T>
class scoped_flags
{
public:
using value_type = std::underlying_type_t<T>;
scoped_flags(std::initializer_list<T> flag_list)
: value_(combine_(flag_list))
@slurpyb
slurpyb / docker-compose.yml
Created June 5, 2021 01:46 — forked from Mau5Machine/docker-compose.yml
Traefik Configuration and Setup
version: "3.3"
services:
################################################
#### Traefik Proxy Setup #####
###############################################
traefik:
image: traefik:v2.0
restart: always
@slurpyb
slurpyb / unifi_ubuntu_2004.sh
Created June 2, 2021 08:59 — forked from davecoutts/unifi_ubuntu_2004.sh
Install Ubiquiti Unifi Controller on Ubuntu 20.04
# Install Ubiquiti Unifi Controller on Ubuntu 20.04.
# As tested on a fresh install of ubuntu-20.04.1-live-server, August 22nd 2020.
# Thanks to https://gist.github.com/tmuncks for posting the updated install steps.
sudo apt update
sudo apt install --yes apt-transport-https
echo 'deb https://www.ui.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list
sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg
// Unity C# Cheat Sheet
// I made these examples for students with prior exerience working with C# and Unity.
// Too much? Try Unity's very good tutorials to get up to speed: https://unity3d.com/learn/tutorials/topics/scripting
@slurpyb
slurpyb / install-pyenv.sh
Created August 28, 2019 15:22
install pyenv
#!/bin/sh
echo '--- installing pyenv from github ---'
git clone https://github.com/pyenv/pyenv.git ~/.pyenv && \
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc && \
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc && \
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc && \
echo '--- pyenv installed, restarting $SHELL---'
exec "$SHELL"
echo '--- done! install python via "pyenv install 3.7.4" ---'