Skip to content

Instantly share code, notes, and snippets.

View PhilReinking's full-sized avatar

Philipp Reinking PhilReinking

View GitHub Profile
@PhilReinking
PhilReinking / disabled.js
Created December 14, 2017 10:45
vue directive to put elements in a disabled state
/**
* Directive to easily toggle utility classes to disable elements
*
* Default usage:
* v-disabled="true" // adds default disabled classes
*
* Advanced usage:
* v-disabled:"{ disabled: true, classes: ['hidden']" // adds specified classes when disabled is true
*
*/
@PhilReinking
PhilReinking / gist:1cf7bf47175e8a478cd7
Last active August 29, 2015 14:20
Celebration Test Snippet
(function(){
'use strict';
var celebrationHeight = jQuery(window).height() - 87;
var celebrationWidth = jQuery(window).width();
if(celebrationHeight < 800) {
return false;
}
@PhilReinking
PhilReinking / gist:d512c6f82fbf9dfb34fe
Last active August 29, 2015 14:16
redirect to mobile site script
// Mobile Detect and redirect
var isMobileSite = document.location.search.match('mobile=1');
var mobileUrl = 'http://www.yoururl.com/';
if( !isMobileSite && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) )
{
window.top.location = mobileUrl + '?mobile=1';
}

Local SSL websites on Mac OSX

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on Mac OSX Yosemite.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward edit to Sublime Text:

alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
@PhilReinking
PhilReinking / index.html
Last active August 29, 2015 14:02
Pouch Issue #2342
<!DOCTYPE html>
<html>
<head>
<title>PouchDB #2342</title>
<script src="pouch.js"></script>
<script src="main.js"></script>
</head>
<body>
</body>
#!/usr/bin/env bash
# Update Repositories
sudo apt-get -y update
sudo apt-get install -y python-software-properties python g++ make
sudo add-apt-repository -y ppa:chris-lea/node.js
sudo apt-get -y update
# NODE