Skip to content

Instantly share code, notes, and snippets.

View jessegilbride's full-sized avatar

Jesse Gilbride jessegilbride

View GitHub Profile
@jessegilbride
jessegilbride / 0_reuse_code.js
Created August 25, 2014 00:52
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// 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 = $( [] );
@jessegilbride
jessegilbride / sublimetext-keybind-overrides.txt
Last active November 2, 2016 15:49
My Sublime Text (2) user preferences
[
// 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...
@jessegilbride
jessegilbride / footer-copyright-updater.js
Created November 13, 2015 00:01
Auto-update footer copyright year
function order() {
var food;
function waiter(order) {
chef(order);
return food;
}
function chef(order) {
if (order === 'pasta') {
food = ['pasta', 'gravy', 'seasoning'];
cook();
@jessegilbride
jessegilbride / smashingmagazine.js
Created July 18, 2016 22:09 — forked from luruke/smashingmagazine.js
Source code of the demo "Improving User Flow Through Page Transitions" on Smashing Magazine.
/*
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]) {
@jessegilbride
jessegilbride / zipCodeValidation.js
Created September 15, 2016 21:33
Form validation for zip code*, using jQuery.validator.js https://jqueryvalidation.org/ * US Postal Code, 5 or 9 digits
$("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).");
@jessegilbride
jessegilbride / HTML5-boilerplate-2020
Last active November 11, 2020 14:53
My current (2020) HTML boilerplate
<!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">
@jessegilbride
jessegilbride / CSS-boilerplate-2020
Created November 11, 2020 15:07
My CSS boilerplate (2020)
:root {
--variableName: value;
}
header {}
main {}
section {
margin: 0 auto; /* center the content */
@jessegilbride
jessegilbride / quiz app links
Created November 23, 2020 06:18
Links to quiz app