Skip to content

Instantly share code, notes, and snippets.

View ChadBailey's full-sized avatar
📦
Relocating to Seattle, responses will be delayed

Chad Bailey ChadBailey

📦
Relocating to Seattle, responses will be delayed
View GitHub Profile
@ChadBailey
ChadBailey / adjust_swap.sh
Last active January 8, 2023 07:26
Adjust swap (page) file size Kubuntu 22.04
#!/bin/sh
# First check to see that swap file is in use, and what size it is
free -h
sudo swapoff -a
ls -al /swapfile
# Too lazy to make a proper interface, just edit the "8GB" to preferred size
sudo fallocate -l 8G /swapfile
# Should now show new size
@ChadBailey
ChadBailey / ubuntu_runbooks.md
Last active January 2, 2023 00:37
Ubuntu Runbooks

Ubuntu Runbooks

These are very direct guides on dealing with specific problems within Ubuntu.

One-liners

  • Check currently running version of Ubuntu: lsb_release -a
  • Check currently running kernel: uname -r (or uname -a)
  • Remove unneeded packages: sudo apt autoremove
  • Apply configuration changes to grub (needed any time grub conf has been modified): sudo update-grub

Mocha JS Testing Toolchain

I invested a reasonably substantial amount of effort in learning to use the Mocha testing toolchain in JS only to find I don't think I like it.

This is to store/share my thoughts outside of the repo in the event I ever want to revisit it

Reason for abandoning

@ChadBailey
ChadBailey / install_wormhole.bat
Created January 31, 2021 19:27 — forked from princebot/install_wormhole.bat
Install Python magic-wormhole on Windows.
::
:: This script installs wormhole (https://github.com/warner/magic-wormhole) and
:: its prerequisites. Run this as an administrator.
::
:: Install chocolatey.
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
:: Install Python 3.
choco install -y python
"""
It may not seem like it, but this is the fruit of a lot of labor.
If you find it helpful, please consider crediting me in your application.
"""
import functools
__author__ = "Chad Bailey"
@ChadBailey
ChadBailey / shadow-dom.md
Created November 2, 2019 21:12 — forked from praveenpuglia/shadow-dom.md
Everything you need to know about Shadow DOM

I am moving this gist to a github repo so more people can contribute to it. Also, it makes it easier for me to version control.

Please go to - https://github.com/praveenpuglia/shadow-dom-in-depth for latest version of this document. Also, if you find the document useful, please shower your love, go ⭐️ it. :)

Shadow DOM

Heads Up! It's all about the V1 Spec.

In a nutshell, Shadow DOM enables local scoping for HTML & CSS.

@ChadBailey
ChadBailey / arch_mirror_locations_and_pings.sh
Last active September 19, 2018 14:38
Get insight into locations and pings of pacman mirrors in Arch Linux
## License not yet determined... if you must share or use please give credit github.com/ChadBailey
#/bin/bash
ATTRIBUTION="This product includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com"
CITYFILE=/tmp/GeoLiteCity.dat
URL=http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz
if ! which geoiplookup >/dev/null 2>&1; then
echo "Error: $0 requires geoip utility."
exit 1
fi
//YouTube Enhanced
//Author Chad Bailey www.chadbailey.me
//Written 10-6-17
//Initialize global variables
var video_element
var current_speed
//Amount to adjust video playback
var speed_step_fine = 0.5