Skip to content

Instantly share code, notes, and snippets.

Kevin Upton kevupton

Block or report user

Report or block kevupton

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
kevupton / fx-if.directive.ts
Last active Sep 1, 2019
Angular Flex Layout fxIf equivalent of ngIf
View fx-if.directive.ts
import { isPlatformBrowser } from '@angular/common';
import { Directive, ElementRef, Inject, Input, OnDestroy, OnInit, PLATFORM_ID } from '@angular/core';
import { MediaObserver } from '@angular/flex-layout';
import { BehaviorSubject, combineLatest, Subscription } from 'rxjs';
selector: '[fxIf],' + ['xs', 'md', 'lg', 'xl', 'lt-sm', 'lt-md', 'lt-lg',
'lt-xl', 'gt-xs', 'gt-sm', 'gt-md', 'gt-lg'].map(key => `[fxIf.${key}]`).join(','),
export class FxIfDirective implements OnInit, OnDestroy {
View scrollcontroller.ts
interface ScrollSectionConfig {
height : number;
speed : number;
interface Vector {
x : number;
y : number;
kevupton / convert-webp
Created Apr 5, 2019
WebP convert all images in current directory
View convert-webp
for file in *
echo "Converting: '$file'"
cwebp -q 80 "$file" -o "webp/$file.webp" > /dev/null 2>&1
echo "Complete!"
kevupton /
Last active Feb 18, 2019
Git Commiter with ID
# BRANCH="feature/AGS-62-agtrader-digital-ad-changes-for-d"
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>&1)
} || {
echo "Is not a git repository..."
exit 1;
kevupton /
Last active Feb 18, 2019
command=$(basename $0)
usage() { printf "Usage: ${BLUE}$command${NC} ${RED}[search-term]${NC} ${GREEN}[-f]${NC}\n" 1>&2; exit 1; }
kevupton /
Last active Nov 13, 2018
User Data for initializing an EC2 using Ubuntu with Docker GPU
sudo apt-get remove docker docker-engine
sudo apt-get update -qq
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
curl -fsSL | sudo apt-key add -
kevupton /
Created Mar 21, 2018
Fix for AWS puppeteer linux instance
# Fixes the puppeteer not being able to spawn an instance on their AWS linux instance.
# Install ATK from CentOS 7
sudo yum install cups-libs dbus-glib libXrandr libXcursor libXinerama cairo cairo-gobject pango
sudo rpm -ivh --nodeps
sudo rpm -ivh --nodeps
sudo rpm -ivh --nodeps
View php-storm.xml
<code_scheme name="Main" version="173">
<option name="ALIGN_KEY_VALUE_PAIRS" value="true" />
<option name="ALIGN_PHPDOC_PARAM_NAMES" value="true" />
<option name="ALIGN_PHPDOC_COMMENTS" value="true" />
<option name="ALIGN_ASSIGNMENTS" value="true" />
<option name="COMMA_AFTER_LAST_ARRAY_ELEMENT" value="true" />
<option name="PHPDOC_BLANK_LINE_BEFORE_TAGS" value="true" />
<option name="PHPDOC_WRAP_LONG_LINES" value="true" />
<option name="ELSE_IF_STYLE" value="COMBINE" />
View index.d.ts
declare namespace store {
const local : StoreAPI;
const session : StoreAPI;
function area (id : string, area : Storage) : StoreAPI;
function set (key : any, data : any, overwrite? : boolean) : any;
function setAll (data : Object, overwrite? : boolean) : StoredData;
function get (key : any, alt? : any) : any;
function getAll () : StoredData;
function transact (key : any, fn : (data : any) => any, alt? : any) : StoreAPI;
You can’t perform that action at this time.