Skip to content

Instantly share code, notes, and snippets.

🥑
I like avocados

Ryan Schumacher jrschumacher

🥑
I like avocados
Block or report user

Report or block jrschumacher

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jrschumacher
jrschumacher / terser.js
Last active Jul 13, 2019
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)
}
@jrschumacher
jrschumacher / build-and-deploy.sh
Last active Apr 23, 2019
Ionic Automated Build and Deploy to HockeyApp
View build-and-deploy.sh
#!/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 / slack-minimize-sidebar.css
Last active Jun 15, 2018
Slack minimized sidebar (stylish
View slack-minimize-sidebar.css
@media (max-width: 950px) {
.client_channels_list_container {
max-width: 100px;
transition: 0.5s;
}
.client_channels_list_container:hover {
max-width: 220px;
}
.client_channels_list_container .p-channel_sidebar {
max-width: 100px;
View dev.zone
$TTL 60
$ORIGIN dev.
@ 1D IN SOA localhost. root.localhost. (45 3H 15M 1W 1D)
1D IN NS localhost.
1D IN A 127.0.0.1
*.dev. 60 IN A 127.0.0.1
go.dev. 60 IN A 127.0.0.1
*.go.dev. 60 IN A 127.0.0.1
View nativefier-pivotal-tracker.sh
nativefier \
--name "Pivotal Tracker" \
--platform "darwin" \
--overwrite \
--icon ~/.nativefier/pivotal_tracker/icon.png \
"https://pivotaltracker.com" \
~/.nativefier/pivotal_tracker
View test_php_skill.php
<?php
/*****************************************
* Created this test for job interviews. *
*****************************************/
/**
* Directions
*
* Read the direction in the Q and respond below A.
View headjs.min.js.cached
(function(n,t){"use strict";function r(n){a[a.length]=n}function k(n){var t=new RegExp(" \\b"+n+"\\b");c.className=c.className.replace(t,"")}function p(n,t){for(var i=0,r=n.length;i<r;i++)t.call(n,n[i],i)}function tt(){var t,e,f,o;c.className=c.className.replace(/ (w-|eq-|gt-|gte-|lt-|lte-|portrait|no-portrait|landscape|no-landscape)\d+/g,""),t=n.innerWidth||c.clientWidth,e=n.outerWidth||n.screen.width,u.screen.innerWidth=t,u.screen.outerWidth=e,r("w-"+t),p(i.screens,function(n){t>n?(i.screensCss.gt&&r("gt-"+n),i.screensCss.gte&&r("gte-"+n)):t<n?(i.screensCss.lt&&r("lt-"+n),i.screensCss.lte&&r("lte-"+n)):t===n&&(i.screensCss.lte&&r("lte-"+n),i.screensCss.eq&&r("e-q"+n),i.screensCss.gte&&r("gte-"+n))}),f=n.innerHeight||c.clientHeight,o=n.outerHeight||n.screen.height,u.screen.innerHeight=f,u.screen.outerHeight=o,u.feature("portrait",f>t),u.feature("landscape",f<t)}function it(){n.clearTimeout(b),b=n.setTimeout(tt,50)}var y=n.document,rt=n.navigator,ut=n.location,c=y.documentElement,a=[],i={screens:[240,320,480,
@jrschumacher
jrschumacher / MongoQueryStr.php
Created Sep 1, 2013
Convert a PHP Mongo query with Mongo* classes to MongoDB js query. Currently supports MongoId => ObjectId, MongoDate => ISODate, and MongoRegex => RegExp. [VERY ROUGH] -- Wrote this because I was tired of getting stuck and having to port the query by hand.
View MongoQueryStr.php
<?php
class MongoQueryStr {
protected static $indent = 0;
public static function convert($query) {
if(!is_array($query)) {
return false;
}
@jrschumacher
jrschumacher / MongoId2.php
Created Dec 5, 2012
MongoId to handle psudo MongoId objects (especially when dealing with json)
View MongoId2.php
<?php
class MongoId2 extends MongoId {
public function __construct($id = null) {
if(is_array($id)) {
$id = (object) $id;
}
if(is_object($id) && isset($id->{'$id'})) {
$id = $id->{'$id'};
}
@jrschumacher
jrschumacher / sub2path.pl
Created Jan 11, 2012
Wildcard domain for local development using Apache Mod Rewrite
View sub2path.pl
#!/usr/bin/perl
###
# Sub2Path is a little script which convert a url with subdomains to a path
#
# To be used with Apache ModRewrite RewriteMap found: http://goo.gl/8WUvm
# Follow the conversation at: http://goo.gl/Mzc5E
# Props to 42foo.com: http://goo.gl/mut77
#
# MIT license
You can’t perform that action at this time.