Skip to content

Instantly share code, notes, and snippets.

View ShawnStringfield's full-sized avatar

Shawn Stringfield ShawnStringfield

View GitHub Profile
{
"type": "chart",
"title": "",
"theme": "theme-blue",
"fontSize": "medium",
"lineDatapointStyle": "hover",
"barHasBorder": "false",
"padding": { "left": 5, "right": 5 },
"yAxis": { "size": 50, "gridLines": false },
"barThickness": 0.35,
@ShawnStringfield
ShawnStringfield / object_literals_switch.js
Created May 3, 2018 15:36
Replacing switch statements with Object literals
// https://toddmotto.com/deprecating-the-switch-statement-for-object-literals/
function getDrink (type) {
return 'The drink I chose was ' + {
'coke': 'Coke',
'pepsi': 'Pepsi',
'lemonade': 'Lemonade'
}[type];
}
@ShawnStringfield
ShawnStringfield / request.js
Created December 8, 2017 13:27 — forked from sheharyarn/request.js
Axios Request Wrapper for React
/**
* Axios Request Wrapper
* ---------------------
*
* @author Sheharyar Naseer (@sheharyarn)
* @license MIT
*
*/
import axios from 'axios'
sudo /Applications/MAMP/Library/bin/apachectl start
@ShawnStringfield
ShawnStringfield / apple-mq.css
Created September 27, 2017 16:27 — forked from AllThingsSmitty/apple-mq.css
iPhone 6/6 Plus and Apple Watch CSS media queries
/* iPhone 6 landscape */
@media only screen and (min-device-width: 375px)
and (max-device-width: 667px)
and (orientation: landscape)
and (-webkit-min-device-pixel-ratio: 2)
{ }
/* iPhone 6 portrait */
@media only screen
and (min-device-width: 375px)
@ShawnStringfield
ShawnStringfield / gulpfile.js
Created January 4, 2017 16:12 — forked from kcmr/gulpfile.js
Pushstate with browserSync (gulp)
var gulp = require('gulp'),
browserSync = require('browser-sync'),
historyApiFallback = require('connect-history-api-fallback');
gulp.task('serve', function() {
browserSync({
files: ['js/**/*.js', '*.html', 'css/**/*.css'],
server: {
baseDir: '.',
middleware: [ historyApiFallback() ]
@ShawnStringfield
ShawnStringfield / multilocation_updates.js
Created May 13, 2016 00:17
Firebase MultiLocation Updates
var ref = new Firebase("https://<YOUR-FIREBASE-APP>.firebaseio.com");
// Generate a new push ID for the new post
var newPostRef = ref.child("posts").push();
var newPostKey = newPostRef.key();
// Create the data we want to update
var updatedUserData = {};
updatedUserData["user/posts/" + newPostKey] = true;
updatedUserData["posts/" + newPostKey] = {
title: "New Post",
content: "Here is my new post!"
@ShawnStringfield
ShawnStringfield / firebasedata.service.js
Last active March 25, 2016 02:37
A nice pattern I found that constructs clean firebase urls. See full repo here: https://github.com/gordonmzhu/angular-course-demo-app-v2
(function() {
'use strict';
angular
.module('app.core')
.factory('firebaseDataService', firebaseDataService);
firebaseDataService.$inject = ['FIREBASE_URL'];
function firebaseDataService(FIREBASE_URL) {
# Download and Install the Latest Updates for the OS
apt-get update && apt-get upgrade -y
# Set the Server Timezone to CST
echo "America/Chicago" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
# Enable Ubuntu Firewall and allow SSH & MySQL Ports
ufw enable
ufw allow 22
.center {
position: relative;
top: 50%;
transform: translateY(-50%);
}