Skip to content

Instantly share code, notes, and snippets.

View jongrover's full-sized avatar

Jonathan Grover jongrover

View GitHub Profile
@jongrover
jongrover / .bash_profile
Last active August 29, 2015 13:56
FIS Bash Profile for Front-end Web Development (minus Homebrew and RVM paths)
# Configuring Our Prompt
# ======================
# if you install git via homebrew, or install the bash autocompletion via homebrew, you get __git_ps1 which you can use in the PS1
# to display the git branch. it's supposedly a bit faster and cleaner than manually parsing through sed. i dont' know if you care
# enough to change it
# This function is called in your prompt to output your active git branch.
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
@jongrover
jongrover / css-gradients.css
Created March 13, 2014 21:40
Some gradients to copy and paste for grey fades
/* LIGHT-FADE */
background: #efefef; /* Old browsers */
background: -moz-linear-gradient(top, #efefef 0%, #ffffff 24%, #ffffff 68%, #dddddd 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#efefef), color-stop(24%,#ffffff), color-stop(68%,#ffffff), color-stop(100%,#dddddd)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #efefef 0%,#ffffff 24%,#ffffff 68%,#dddddd 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #efefef 0%,#ffffff 24%,#ffffff 68%,#dddddd 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #efefef 0%,#ffffff 24%,#ffffff 68%,#dddddd 100%); /* IE10+ */
background: linear-gradient(to bottom, #efefef 0%,#ffffff 24%,#ffffff 68%,#dddddd 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#efefef', endColorstr='#dddddd',GradientType=0 ); /* IE6-9 */
@jongrover
jongrover / email-regex-filter.txt
Created March 31, 2014 18:09
JavaScript Email Regex Filter
/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/
@jongrover
jongrover / .gitconfig
Created April 3, 2014 17:28
Git configuratiuon
[core]
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = /Users/jonathangrover/.gitignore_global
[alias]
st = status
ci = commit
br = branch
co = checkout
df = diff
lg = log -p
@jongrover
jongrover / .gitignore_global
Created April 3, 2014 17:29
GIT ignore global
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@jongrover
jongrover / gist:2279676f978c5bbaf21c
Created July 23, 2014 21:36
live_event_listener.js
// Regular event listener applys a listener once at the moment the DOM loads and the document is ready.
$('button').click(function(){});
// Under the hood jQuery really calls the on() method.
$('button').on('click', function(){});
// The Problem
@jongrover
jongrover / index.html
Last active August 29, 2015 14:10
CSS - Micro Grid System ( fluid with 2% margins)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Micro Grid Example</title>
<link rel="stylesheet" href="micro-grid-fluid-2p-margins.css">
</head>
<body>
<div class="container">
@jongrover
jongrover / jquery.colorcycle-ordered.js
Created December 5, 2014 20:34
jQuery Color Cycle Plugin Modified to change colors in order instead of selecting colors randomly
/* jQuery Color Cycle Plugin - v0.1.1 - created by: jon@flatironschool.com */
(function ($) {
$.fn.colorCycle = function( options ) {
var settings = $.extend({
colors: ['#ff0000', '#ff6600', '#ff9900', '#ffcc00', '#ffff00', '#ccff00', '#99ff00', '#66ff00', '#00ff66', '#00ff99', '#00ffcc', '#00ffff', '#00ccff', '#0099ff', '#0066ff', '#0033ff', '#0000ff', '#3300ff', '#6600ff', '#9900ff', '#cc00ff', '#ff00ff', '#ff00cc', '#ff0099', '#ff0066'],
animationStartRange: 1000,
animationEndRange: 2000,
loopStartRange: 1000,
@jongrover
jongrover / contact.css
Last active November 10, 2015 15:41
Front-end / Back-end Validated Email Mailer Form Submission Solution using HTML5, PHP5, JavaScript, and jQuery
input.error, textarea.error {
border: 1px solid red;
}
span.error {
display: none;
color: red;
}
@jongrover
jongrover / js-part-01.md
Last active December 19, 2015 01:49
Instructable content for JavaScript part 1

JavaScript Part 1

Topics:

  • Variables & Data types
  • Conditional Statements
  • Functions & Scope
  • setting up a document to use jQuery
  • jQuery Selectors & Methods
  • Retrieving Form Values
  • Arrays