Skip to content

Instantly share code, notes, and snippets.

View cstrat's full-sized avatar
🌶️
Spicy!

Chris Stratford cstrat

🌶️
Spicy!
View GitHub Profile
@mbierman
mbierman / install_speedtest.sh
Last active May 18, 2023 20:27
Install Speedtest for firewalla
#!/bin/bash
# 2.1.0
# https://gist.github.com/mbierman/9ac6a35622ee5a0c631ed6f6ad74b722
# Put this script in ~/.firewalla/config/post_main.d in order to resinstall after upgrades
log=/data/fw_reboot.txt
if ! [ -w $log ] ; then
sudo touch $log
sudo chmod a+w $log
@dchakro
dchakro / pi.status.sh
Last active December 5, 2021 11:03
Bash shell script to print stats about a Raspberry Pi running pihole
#!/usr/bin/env bash
# Define colors
RED='\033[91m'
RED_solid='\033[101m'
GREEN='\033[92m'
GREEN_solid='\033[42m'
CYAN='\033[96m'
NC='\033[0m'
BLUE_solid='\e[44m'
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@hagemann
hagemann / slugify.js
Last active October 30, 2023 09:10
Slugify makes a string URI-friendly
function slugify(string) {
const a = 'àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìıİłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;'
const b = 'aaaaaaaaaacccddeeeeeeeegghiiiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------'
const p = new RegExp(a.split('').join('|'), 'g')
return string.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(p, c => b.charAt(a.indexOf(c))) // Replace special characters
.replace(/&/g, '-and-') // Replace & with 'and'
.replace(/[^\w\-]+/g, '') // Remove all non-word characters
@danharper
danharper / background.js
Last active March 30, 2024 18:25
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});