Skip to content

Instantly share code, notes, and snippets.


Ryan Schumacher jrschumacher

View GitHub Profile
jrschumacher / __Tagged Template Literal To
Last active Aug 1, 2020
Tagged template literal helper to regenerate the string
View __Tagged Template Literal To
title tags date
Using template tags for simple logging
tags, javascript, logging

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 / virtru-secchat-server.js
Created Jan 21, 2020
Virtru Secure Chat 2/3: Application Bootstrap
View virtru-secchat-server.js
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'new-message', payload);
// Send new message to user
jrschumacher / virtru-secchat-app.js
Last active Jan 21, 2020
Virtru Secure Chat 2/3: Application Bootstrap
View virtru-secchat-app.js
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 (

Keybase proof

I hereby claim:

  • I am jrschumacher on github.
  • I am beardedhen ( on keybase.
  • I have a public key ASC6OdQnn5OuoVqiF7xdoRF4GqkBKFQC7t655cKNzUluewo

To claim this, I am signing this object:

jrschumacher / terser.js
Last active Nov 1, 2020
A terser script to minify all javascript files in a directory
View terser.js
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)
nativefier \
--name "Pivotal Tracker" \
--platform "darwin" \
--overwrite \
--icon ~/.nativefier/pivotal_tracker/icon.png \
"" \
jrschumacher /
Last active Apr 23, 2019
Ionic Automated Build and Deploy to HockeyApp
STARTTIME=$(date +%s);
set -e
set -x
### Install dependencies
echo "--- Install dependencies [Time Elapsed $(($(date +%s) - $STARTTIME))s]"
View gist:58e5189942f28053a9e1
$ docker ps
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>5000/tcp dreamy_hopper
jrschumacher / travis-ci-test-mongo-connectivity.yml
Created Mar 14, 2014
Travis-CI test for MongoDB connectivity before script
View travis-ci-test-mongo-connectivity.yml
# 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
- |
echo "Testing MongoDB connection...";tries=4;
while [ $i -lt $tries ]; do fail=$(mongo --eval db 2>&1 >/dev/null | grep "connect failed");
jrschumacher /
Last active Aug 29, 2015 — forked from vidoss/gist:2178987
MongoDB provides a Javascript shell. But Javascript is no fun without Underscore.js ( Here is how to add Underscore.js

MongoDB provides a Javascript shell. But Javascript is no fun without Underscore.js

Turned out its straight forward to use Underscore.js while scripting mongodb.

Here are the steps:

  1. Download or clone Underscore.js and run...
% mongo server:27017/dbname underscore.js my_commands.js
You can’t perform that action at this time.