Skip to content

Instantly share code, notes, and snippets.

View jrschumacher's full-sized avatar
🤏

Ryan Schumacher jrschumacher

🤏
View GitHub Profile
@jrschumacher
jrschumacher / microcosm-onix-bisac-codes.csv
Created December 28, 2020 16:42 — forked from natebeaty/microcosm-onix-bisac-codes.csv
ONIX BISAC codes from microcosm publishing database, with some manually entered codes — use at your own risk!
ANT000000 Antiques & Collectibles / General
ANT001000 Antiques & Collectibles / Americana
ANT002000 Antiques & Collectibles / Art
ANT003000 Antiques & Collectibles / Autographs
ANT005000 Antiques & Collectibles / Books
ANT006000 Antiques & Collectibles / Bottles
ANT007000 Antiques & Collectibles / Buttons & Pins
ANT008000 Antiques & Collectibles / Care & Restoration
ANT009000 Antiques & Collectibles / Transportation
ANT010000 Antiques & Collectibles / Clocks & Watches
@jrschumacher
jrschumacher / __Tagged Template Literal To String.md
Last active August 1, 2020 12:41
Tagged template literal helper to regenerate the string
title tags date
Using template tags for simple logging
tags, javascript, logging
08-01-2020

Tagged template literal helper which regenerates the string

Often times I've wanted to utilize Tagged Template Literals to make writing logs super easy. This has often alluded me due to the structure of tags.

@jrschumacher
jrschumacher / virtru-secchat-server.js
Created January 21, 2020 17:09
Virtru Secure Chat 2/3: Application Bootstrap
try {
const user = socket.nickname;
if (!user) throw new Error('Your session is not registered. Please make sure to login.');
const response = await pouchDB.addMessage(channel, message, user);
const payload = { ...response, message, user };
// Send ok response
socket.emit('add-message-ok', response);
// Broadcast message to room
socket.broadcast.to(channel).emit('new-message', payload);
// Send new message to user
@jrschumacher
jrschumacher / virtru-secchat-app.js
Last active January 21, 2020 17:12
Virtru Secure Chat 2/3: Application Bootstrap
import React from 'react';
import { ClientSocket as SocketIOProvider } from 'use-socketio';
import { VirtruProvider } from '../hooks/useVirtru';
import AuthenticationModal from '../components/authenticationModal';
import Room from '../components/room';
function App() {
return (
<VirtruProvider>
<SocketIOProvider>

Keybase proof

I hereby claim:

  • I am jrschumacher on github.
  • I am beardedhen (https://keybase.io/beardedhen) on keybase.
  • I have a public key ASC6OdQnn5OuoVqiF7xdoRF4GqkBKFQC7t655cKNzUluewo

To claim this, I am signing this object:

@jrschumacher
jrschumacher / terser.js
Last active March 25, 2024 16:10
A terser script to minify all javascript files in a directory
const fs = require('fs')
const {sync: globSync} = require('glob')
const filesize = require('filesize')
const Terser = require('terser')
const options = require(process.env.TERSER_CONFIG || './terserrc.json')
const getSize = (file) => {
const {size} = fs.statSync(file)
return filesize(size)
}
@jrschumacher
jrschumacher / nativefier-pivotal-tracker.sh
Created March 3, 2016 19:01
Nativefier Pivotal Tracker
nativefier \
--name "Pivotal Tracker" \
--platform "darwin" \
--overwrite \
--icon ~/.nativefier/pivotal_tracker/icon.png \
"https://pivotaltracker.com" \
~/.nativefier/pivotal_tracker
@jrschumacher
jrschumacher / build-and-deploy.sh
Last active April 23, 2019 17:38
Ionic Automated Build and Deploy to HockeyApp
#!/bin/bash
PROJECT_NAME=MyApp
SCHEME_NAME=MyApp
STARTTIME=$(date +%s);
set -e
set -x
### Install dependencies
echo "--- Install dependencies [Time Elapsed $(($(date +%s) - $STARTTIME))s]"
@jrschumacher
jrschumacher / gist:58e5189942f28053a9e1
Created January 16, 2015 18:03
docker latest no port issue
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
32b9ac00b8fa dokku/coach:latest "/bin/bash -c '/star About an hour ago Up About an hour determined_bardeen
ed13cc0c60b6 dokku/helloworld:latest "/bin/bash -c '/star About an hour ago Up About an hour 0.0.0.0:49154->5000/tcp dreamy_hopper
@jrschumacher
jrschumacher / travis-ci-test-mongo-connectivity.yml
Created March 14, 2014 17:41
Travis-CI test for MongoDB connectivity before script
# This script will test for MongoDB connectivity.
# If MongoDB is available then it continues else it tries X times then fails.
#
# Use: Add this to your `before_script` option
before_script:
- |
echo "Testing MongoDB connection...";tries=4;
i=0;
while [ $i -lt $tries ]; do fail=$(mongo --eval db 2>&1 >/dev/null | grep "connect failed");