Skip to content

Instantly share code, notes, and snippets.

View Meandmybadself's full-sized avatar

Jeffery Bennett Meandmybadself

View GitHub Profile
@Meandmybadself
Meandmybadself / ngpvan.js
Last active September 27, 2022 16:23
Mark NGPVan emails as spam
function filterNGPVANSpam() {
// Look for emails containing "unsubscribe" sent in the past week.
// This'll be more than just NGPVAN emails. We'll look in their headers below.
const lastWeek = new Date((new Date()).getTime() - 604800000)
const lastWeekStr = lastWeek.getFullYear() + '/' + (lastWeek.getMonth()+1) + '/' + lastWeek.getDate()
// The gmail query "unsubscribe after: DATE"
const query = 'unsubscribe after:' + lastWeekStr
// Search for any email thread that meets this criteria.
const threads = GmailApp.search(query)
for(let i=0; i < threads.length; i++) {
@Meandmybadself
Meandmybadself / devpost.js
Last active January 31, 2022 05:00
Devpost - Get username & skills from participants list
// Get users' names & skills from a devpost participants page.
// eg, https://slack.devpost.com/participants
let output = ''
document.querySelectorAll('div.participant').forEach(el => {
try {
const name = el.querySelector('h5 .user-profile-link').innerText
if (name) {
const skills = [...el.querySelectorAll('span.recognized-tag')].map(el => el.innerText.toLowerCase().replace(/\s+/g, '-'))
if (skills.length) {
@Meandmybadself
Meandmybadself / pihole.txt
Created December 31, 2021 19:15
Pi-Hole-to-AdGuard list
This file has been truncated, but you can view the full file.
! Ported from https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
! Title: StevenBlack/hosts
!
! This hosts file is a merged collection of hosts from reputable sources,
! with a dash of crowd sourcing via GitHub
!
! Date: 30 December 2021 19:03:10 (UTC)
! Number of unique domains: 100,621
!
! Fetch the latest version of this file: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
@Meandmybadself
Meandmybadself / labels.json
Last active May 27, 2021 17:31
Avery Address Label Template Sizes
[
{
"id": "5160",
"h": 1,
"w": 2.625,
"color": "White",
"count": 30
},
{
"id": "8160",
@Meandmybadself
Meandmybadself / install.sh
Last active December 31, 2020 04:50
Compile nginx on Mac OS X 10.9.5
# Run as su
# Kill Apache.
sudo apachectl -k stop
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
curl -OL http://nginx.org/download/nginx-1.14.0.tar.gz
tar -xvzf nginx-1.14.0.tar.gz
# PCRE for doing regex in nginx
@Meandmybadself
Meandmybadself / countdown.ino
Last active December 3, 2020 05:23
Particle Photon + Neopixels countdown
/**
Parts:
- Particle Photon (wireless Arduino):
https://store.particle.io/collections/wifi/products/photon
- RGB LEDs:
https://www.amazon.com/gp/product/B00ZHB9M6A/ref=ppx_yo_dt_b_asin_title_o04_s00?ie=UTF8&psc=1
- Logic Level shifter (makes the 3.3v Photon play nice w/ the 5V RGB LEDs)
https://www.amazon.com/gp/product/B00NAY3J7O/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&psc=1
@Meandmybadself
Meandmybadself / countdown.ino
Created December 2, 2020 06:33
Inauguration Countdown Clock Photon + Neopixels.
// See https://github.com/technobly/Particle-NeoPixel
#include <neopixel.h>
// Needed for ceil / floor
#include <math.h>
#define ONE_DAY_MILLIS (24 * 60 * 60 * 1000)
unsigned short PIXELS_PER_SEGMENT = 9;
unsigned short SEGMENTS_PER_CHAR = 7;
@Meandmybadself
Meandmybadself / FontAwesome5.json
Created January 4, 2018 17:38
Font Awesome 5 glyph map
{
"500px": 62062,
"accessible-icon": 62312,
"accusoft": 62313,
"address-book": 62137,
"address-card": 62139,
"adjust": 61506,
"adn": 61808,
"adversal": 62314,
"affiliatetheme": 62315,
@Meandmybadself
Meandmybadself / www.domain.com.conf
Last active January 4, 2020 17:54
NGINX basic server config
http {
index index.html;
server {
server_name www.domain.com domain.com
access_log logs/www.domain.com.access.log main;
root /var/www/www.domain.com/;
}
}
@Meandmybadself
Meandmybadself / replace.js
Created September 4, 2019 17:42
Globally replace mass-lodash imports
const { exec } = require("child_process");
const fs = require("fs");
const script = exec(
"grep -lir --exclude-dir={android,ios,node_modules,coverage} \"import _ from 'lodash'\" . | grep -v .map"
);
let filesToUpdate;
const fixNextFile = () => {