Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeffery Bennett Meandmybadself

View GitHub Profile
@Meandmybadself
Meandmybadself / labels.json
Last active May 27, 2021
Avery Address Label Template Sizes
View labels.json
[
{
"id": "5160",
"h": 1,
"w": 2.625,
"color": "White",
"count": 30
},
{
"id": "8160",
@Meandmybadself
Meandmybadself / install.sh
Last active Dec 31, 2020
Compile nginx on Mac OS X 10.9.5
View install.sh
# 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 Dec 3, 2020
Particle Photon + Neopixels countdown
View countdown.ino
/**
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 Dec 2, 2020
Inauguration Countdown Clock Photon + Neopixels.
View countdown.ino
// 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 Jan 4, 2018
Font Awesome 5 glyph map
View FontAwesome5.json
{
"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 Jan 4, 2020
NGINX basic server config
View www.domain.com.conf
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 Sep 4, 2019
Globally replace mass-lodash imports
View replace.js
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 = () => {
View merge-csv.js
const csv = require('csvtojson')
const _ = require('lodash')
const Json2csvParser = require('json2csv').Parser
;(async () => {
const points = await csv().fromFile('./points.csv')
let data = await csv().fromFile('./data.csv')
data = data.map(row => {
const username = row.Username
@Meandmybadself
Meandmybadself / image-dims.js
Created Aug 29, 2018
Provides resolution for all images in a given directory.
View image-dims.js
const sizeOf = require('image-size')
const glob = require('glob')
glob('*.*', {nodir: true, cwd: './i/'}, (err, files) => {
files.forEach(f => {
const dims = sizeOf(`./i/${f}`)
console.log(`${f}\t${dims.width}\t${dims.height}`)
})
})
@Meandmybadself
Meandmybadself / fpo.js
Created Aug 14, 2018
Create FPO imagery from strings.
View fpo.js
const http = require('http')
const fs = require('fs')
let imgs = [
"Image 1 Name",
"Image 2 Name",
"Image 3 Name",
]
const slugify = text =>