Skip to content

Instantly share code, notes, and snippets.

View influxweb's full-sized avatar
Coffee Helps Me Focus...Coffee Helps Me Focus...Coffee Helps Me Focus...

Matt Zimmermann influxweb

Coffee Helps Me Focus...Coffee Helps Me Focus...Coffee Helps Me Focus...
View GitHub Profile
@influxweb
influxweb / loadPageSection.js
Created April 7, 2017 23:59 — forked from lazamar/loadPageSection.js
Vanilla JS implementation of JQuery's .load
/**
* Loads an HTML document from a URL and retuns an element selected using
* the 'selector' parameter
* Example usage:
* loadPageSection('./myPage.html', '#container', (r, err) => console.log(r, err));
*
* @method loadPageSection
* @param {String} url
* @param {String} selector - A valid CSS selector
* @param {Function} callback - To be called with two parameters (response, error)
@influxweb
influxweb / how-to-disable-html-links-with-css.md
Created March 30, 2017 02:49 — forked from nepsilon/how-to-disable-html-links-with-css.md
How to disable HTML links with CSS? — First published in fullweb.io issue #92
@influxweb
influxweb / how-to-force-a-file-download-in-the-browser.md
Created March 30, 2017 02:49 — forked from nepsilon/how-to-force-a-file-download-in-the-browser.md
How to force a file download in the browser? — First published in fullweb.io issue #92

How to force a file download in the browser?

The use case is simple, you have /reports/593874951.pdf on your web server and want to let your user download it — and if possible with a meaningful name.

In the past, you may tried using the Content-Disposition HTTP header to achieve this, but today, with Safari getting the support for the download attribute it’s going to simplify a lot of things.

Using the download attribute is simple as pie:

<a href="/reports/593874951.pdf" download="report.pdf">
 Download report
@influxweb
influxweb / dom-helper.js
Created March 29, 2017 20:08 — forked from SitePointEditors/dom-helper.js
Mini jQuery, sort of.
/**
* A collection of helper prototype for everyday DOM traversal, manipulation,
* and event binding. Sort of a minimalist jQuery, mainly for demonstration
* purposes. MIT @ m3g4p0p
*/
window.$ = (function (undefined) {
/**
* Duration constants
* @type {Object}
@influxweb
influxweb / debounce-es2015.js
Created January 3, 2017 20:34 — forked from vincentorback/debounce-es2015.js
Smarter debouncing
export function debounce(fn, wait) {
let timeout;
return function () {
clearTimeout(timeout);
timeout = setTimeout(() => fn.apply(this, arguments), (wait || 1));
}
}

Improved .sr-only

Theorically bulletproof CSS class for visually hide anything and keep it accessible to ATs.

A Pen by ffoodd on CodePen.

License.

@influxweb
influxweb / README.md
Created October 5, 2016 18:50 — forked from steveosoule/README.md
Dynamic Resize Images Based on URL
// --------------------------------------------------------------------------------------
// A More Modern Scale for Web Typography
// Based on this article: http://typecast.com/blog/a-more-modern-scale-for-web-typography
// --------------------------------------------------------------------------------------
$body-font-size: 1em !default;
// Adjusts body typography to be default
// for each browser.
@mixin reset-body-font-size($font-size: 100%, $size-adjustment: 0.5) {
@influxweb
influxweb / example.html
Created August 15, 2016 19:26 — forked from ryantownsend/example.html
ITCSS Flexbox Grid Object
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="stylesheet" href="main.css" />
<title>ITCSS Grid Example</title>
</head>
<body>
@influxweb
influxweb / RWD-|-Responsive-HTML5-form-elements-with-CSS-Flexbox.markdown
Created July 12, 2016 22:42
RWD | Responsive HTML5 form elements with CSS Flexbox