Instantly share code, notes, and snippets.

View hide on click
$(document).mouseup(function (e) {
var menu = $('.side-menu');
if (e.target !== menu[0] && !menu.has(e.target).length) {
hideSideMenu();
};
});
View math random
function mtRand(min, max) {
return Math.floor(Math.random() * (max - min + 1));
}
View open-w-atom.reg
Windows Registry Editor Version 5.00
;
; Adds 'Open in Atom' to context menu (when you right click) in Windows Explorer.
;
; Based on https://github.com/Zren/atom-windows-context-menu. It didn't work
; https://github.com/Zren/atom-windows-context-menu/issues/1.
;
; Save this file to disk with a .reg extension. Replace C:\\Atom\\atom.exe with
; the path to the atom executable on your machine.
View index.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Timer Lesson</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
View button.sass
.button
display: inline-block
border: none
color: #fff
text-decoration: none
background-color: $accent
padding: 15px 45px
font-size: 13px
text-transform: uppercase
font-weight: 600
View html5boilerplate.jade
!!! 5
html(class='no-js')
head
meta(charset='utf-8')
meta(http-equiv='X-UA-Compatible', content='IE=edge')
title
meta(name='description', content='')
meta(name='viewport', content='width=device-width, initial-scale=1')
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

View SVG fallback
// SVG Fallback
if (!Modernizr.svg) {
$('img[src*="svg"]').attr(src, function() {
return $(this).attr('src').replace('.svg', '.png');
})
}
View Chrome Smooth Scroll
// Chrome Smooth Scroll
try {
$.browserSelector();
if($('html').hasClass('chrome')) {
$.smoothScroll();
console.log('this is chrome');
}
} catch(err) {
};