Skip to content

Instantly share code, notes, and snippets.


Kevin Carmody skinofstars

View GitHub Profile
skinofstars / getUSPSKeylineCheckDigit.spec.ts
Created June 14, 2021 18:40
USPS Traditional ACS keyline MOD 10 check digit
View getUSPSKeylineCheckDigit.spec.ts
const keylinesChecks: [string, number][] = [
['JLSTMS6796', 9],
['TMS1112/62', 3],
['218XN91LMS', 4],
['ABC999NN//3', 2],
['ANIT 028', 1],
['0012 ////', 8],
['811N IS00 0111', 9],
['OTUB IKAL AM', 8],
skinofstars / crypt.js
Last active October 6, 2020 22:06
Public-key Cryptography in NodeJS
View crypt.js
const crypto = require('crypto');
const read = require('fs').readFileSync;
// The original message
const message = Buffer.from('Hi Alice! This is a secret :)');
// ENCRYPT message with Alice PUBLIC key
const alicePublicKey = read('./keys/alice/public_key.pem');
skinofstars / .gitignore
Created August 19, 2020 08:37
XCode Swift gitignore
View .gitignore
# Node builds
# Exclude build output
skinofstars /
Last active August 11, 2020 10:12

I believe the president Made America Great Again. I believe we need him reelected to Make America Great Again Again.

I believe Joe Biden is “Sleepy” and “weak.” I believe Biden could “hurt God” and the Bible.

I believe that if Biden is elected, there will be “no religion, no anything,” and he would confiscate all guns, “immediately and without notice.” He would “abolish” “our great,” “beautiful suburbs,” not to mention “the American way of life.” There would be “no windows, no nothing” in buildings.

I believe the news media would have “no ratings” and “will go down along with our great USA!” if the president loses — and that this would be bad even though the media is fake.

I believe it’s normal for the president to say “Yo Semites” and “Yo Seminites,” “Thigh Land,” “Minne-a-napolis,” “toe-tally-taria-tism,” “Thomas Jeffers” and “Ulyss-eus S. Grant.” I believe it’s Biden who’s cognitively impaired.

skinofstars / services.js
Created June 13, 2019 10:03
FeathersJS - Demo of services picking up each others hooks
View services.js
module.exports = function(app) {
class BeepBoop {
async update(id, data, params) {
console.log("BeepBoop", id, params);
// passing params here will also pass the
await app.service("zap").update("456", {}, params);
return Promise.resolve();
skinofstars / model-includes.hook.js
Last active August 10, 2017 02:57
Feathers hook for including seqeulize models
View model-includes.hook.js
'use strict';
// Feathers hook to do `/thing?includes=other`
// before : {
// find: [modelIncludes()],
// get: [modelIncludes()]
// },
// after : {
// find: [modelIncludes()],
skinofstars / migrate.js
Created May 2, 2017 14:00
Simple sequelize migration retry script
View migrate.js
#!/usr/bin/env node
'use strict';
const program = require('commander');
const exec = require('child_process').exec;
skinofstars / headersMiddleware.js
Last active May 2, 2017 13:37
Feathers schema switching in sequelize
View headersMiddleware.js
// setup a middleware that provides access to the express headers
module.exports = (req, res, next) => {
req.feathers.headers = req.headers;
skinofstars /
Created November 8, 2016 14:14
Some of the scripts needed to use Docker on AWS ECR and lastoc Beanstalk
# usage: ./ staging f0478bd7c2f584b41a49405c91a439ce9d944657
skinofstars /
Created August 2, 2016 11:43
quick ISP lookup
# - Save as, then run the commands
# - chmod +x
# - ./ ip_addresses.txt
# It reads the ip_address.txt line by line,
# does a whois request on each line, and looks
# for the term 'netname' in each whois.