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 / Elegant and accessible content toggle with CSS.markdown
Created November 11, 2015 15:36
Elegant and accessible content toggle with CSS
@influxweb
influxweb / product_display_layout.html
Created January 4, 2016 22:48
Booc ReadyTheme - Product Display Layout :: UPDATED
<section class="bg--white h-corners product-details">
<article itemscope itemtype="http://schema.org/Product">
<div class="row h-nm">
<div class="column whole">
<mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields:product_flags">
<mvt:if expr="l.settings:product:customfield_values:customfields:product_flags EQ 'On Sale'">
<mvt:assign name="l.settings:product:flagColor" value="'bg--red color--white'" />
<mvt:elseif expr="l.settings:product:customfield_values:customfields:product_flags EQ 'New'">
<mvt:assign name="l.settings:product:flagColor" value="'bg--green'" />
<mvt:else>
.masonry-layout {
box-sizing: border-box;
-webkit-column-count: 1;
-moz-column-count: 1;
column-count: 1;
-webkit-column-gap: 0;
-moz-column-gap: 0;
column-gap: 0;
}
.masonry-layout * {
@influxweb
influxweb / README.md
Created February 24, 2016 20:16 — forked from aaronsama/README.md
Star rating
@influxweb
influxweb / .gitconfig
Created May 3, 2016 00:14 — forked from nepsilon/a-better-setup-for-git.md
A better setup for Git
# The basics, who you commit as:
[user]
name = John Doe
email = john@doe.org
# Your Github username
[github]
user = githubusername
# Some aliases to save 1000s keystrokes each year:
[alias]
log = log --color
@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

If you're building a web app, it's good to be familiar with the different techniques to disable the right-click menu, AKA context menu. Of course, many would suggest this should never be done, but now that web apps are pushing more towards native behavior, I'm sure a lot of developers will be interested in doing this sort of thing.

Here I'm listening for the contextmenu event, then I use event.preventDefault() (like the old return false) to keep the menu from appearing. This disables the context menu whether it's accessed via mouse or keyboard.

To disable the context menu, the best technique is as follows:

window.addEventListener('contextmenu', function (e) {
	console.log('context menu disabled');
	e.preventDefault();
@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 / quick-maintenance-tip.md
Last active September 2, 2016 16:11
Assuming you're still using ES5, here's a quick maintenance tip regarding immediately invoked anonymous functions that have a return value that you assign to a variable.

Here's some example code:

var myVar = function() {
  // function body goes here...
  return {
    value: "something"
  }
}();
// --------------------------------------------------------------------------------------
// 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) {