Skip to content

Instantly share code, notes, and snippets.

View Matt-Jensen's full-sized avatar
🟩
GREEN SQUARE GOOD

Matt-Jensen Matt-Jensen

🟩
GREEN SQUARE GOOD
View GitHub Profile
<!-- Place favicon.ico and apple-touch-icon(s) in the root directory -->
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-ipad-retina.png" />
<link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-iphone-retina.png" />
<link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-ipad.png" />
<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-iphone.png" />
@Matt-Jensen
Matt-Jensen / gist:9dc5b00bae4e167b31c3
Last active August 29, 2015 14:14
Expensify Invoice Constructor
function Invoicerizer(date, duration, tasks) {
this.date = date;
this.duration = duration;
this.tasks = tasks;
}
Invoicerizer.prototype = {
init: function() {
$('.expensicons.expensicons-plus').trigger('click');
@Matt-Jensen
Matt-Jensen / Detect Pointer Type
Last active December 19, 2015 03:19
This could be a horrible idea but this is a short function that detects the supported pointer type and returns a string to use with event listeners.
// Determine the supported pointer event, whether click or touch ect.
function supportedClickEvent() {
var supportedEvent = 'click';
if( 'ontouchstart' in window ) {
supportedEvent = 'touchstart';
}
else if( window.navigator.msPointerEnabled ) {
supportedEvent = 'MSPointerDown';
}
@Matt-Jensen
Matt-Jensen / 100% viewport height and width
Last active December 19, 2015 19:18
Quick css snippet for a 100% viewport width and height for full screen background images and the like. Keeps everything in the flow of the DOM as well.
/* Parent Element */
#background-container {
height: 100%;
min-height: 100%;
width: 100%;
position: relative;
background: black;
}
/* Child Element */
@Matt-Jensen
Matt-Jensen / Sass Retina Query Mixin
Last active December 22, 2015 01:19
A sass function to generate retina media queries.
/* Update: 5/3/14 - supports IE9+, FF3.5+, Opera9.5+ */
@mixin retina($query: null, $density: 2) {
$dpi: $density * 96;
/* Accepts optional @media query conditions */
@if $query {
$query: "and (#{$query})";
}
@else {
var phoneRegExp = /^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/;
Verifying that +mattjensen is my blockchain ID. https://onename.com/mattjensen
0xFbbf996d047D49488CDb782e823817ecE779247C
export default (...fns) => x => fns.reduce((v, f) => f(v), x);
// pipe(double, add1)(2) === 5
export default (...fns) => x => fns.reduceRight((v, f) => f(v), x)
// compose(double, add1)(2) === 6