This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This jQuery plugin will gather the comments within | |
// the current jQuery collection, returning all the | |
// comments in a new jQuery collection. | |
// | |
// NOTE: Comments are wrapped in DIV tags. | |
jQuery.fn.comments = function( blnDeep ){ | |
var blnDeep = (blnDeep || false); | |
var jComments = $( [] ); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
// Causes tabs to switch like a browser... | |
{ "keys": ["ctrl+tab"], "command": "next_view" }, | |
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" }, | |
// Returns home/end keys to their original usage... | |
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} }, | |
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} }, | |
// Related to above, allows for highlighting with shift+home/end... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function order() { | |
var food; | |
function waiter(order) { | |
chef(order); | |
return food; | |
} | |
function chef(order) { | |
if (order === 'pasta') { | |
food = ['pasta', 'gravy', 'seasoning']; | |
cook(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
https://www.smashingmagazine.com/2016/07/improving-user-flow-through-page-transitions/ | |
You can copy paste this code in your console on smashingmagazine.com | |
in order to have cross-fade transition when change page. | |
*/ | |
var cache = {}; | |
function loadPage(url) { | |
if (cache[url]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("form").validate({ | |
rules: { | |
Zip: {zipCodeValidation: true} // hook in custom zip code validation | |
} | |
}); | |
$.validator.addMethod("zipCodeValidation", function() { | |
var zipCode = $('input#zip').val(); | |
return (/(^\d{5}$)|(^\d{5}-\d{4}$)/).test(zipCode); // returns boolean | |
}, "Please enter a valid US zip code (use a hyphen if 9 digits)."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width initial-scale=1"> | |
<meta name="description" content=""> | |
<title>Page Title</title> | |
<!-- CSS reset --> | |
<link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" rel="stylesheet"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:root { | |
--variableName: value; | |
} | |
header {} | |
main {} | |
section { | |
margin: 0 auto; /* center the content */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repo: | |
https://github.com/jessegilbride/quiz-app | |
live demo: | |
https://jessegilbride.github.io/quiz-app/ |
OlderNewer