Skip to content

Instantly share code, notes, and snippets.

View jesgundy's full-sized avatar

Jesse Gundy jesgundy

View GitHub Profile
@jesgundy
jesgundy / Helpers.md
Last active February 22, 2023 16:24
Git Helpers

Remove References to Remote branches that don't exist

git remote prune origin

Delete all local branches that don't have a remote

git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
@jesgundy
jesgundy / sass-system.md
Created June 27, 2013 18:43
Outlining a system for writing Sass.

Sass 'Alphabetization'

I wanted to outline a potential system for organizing Sass declarations. Since Alphabetization has also been a hot topic (of which I am in favor), it outlines how things such as nesting, @extend, @include, and comments would all fall into the same system. This is by no means a perfect system - but after using Sass for a variety of different things, this is the organization I've found that can deal most easily with edge cases.

Please feel free to critique / edit / etc.

Order of Items

  1. Module label - Succinct top-level label for the section of code (if applicable)
  2. Selector
@jesgundy
jesgundy / gulpfile.js
Created June 3, 2020 20:32 — forked from danharper/gulpfile.js
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@jesgundy
jesgundy / stacks.scss
Created December 6, 2012 19:32
Curated system font stacks
// Helvetica Font Stack
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
// Times New Roman-based stack
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
// Modern Georgia-based serif stack
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif;
@jesgundy
jesgundy / favicon.html
Last active December 30, 2018 20:03
Favicon & iOS/Android/MS Image tags (via threespot/shortline)
<!-- Remember this needs to be an icon bundle with 16px and 32px in it -->
<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon">
<!-- iOS/Android -->
<meta name="apple-mobile-web-app-title" content="FIXME">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="/apple-touch-icon-152x152-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch-icon-144x144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="/apple-touch-icon-120x120-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/apple-touch-icon-114x114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="/apple-touch-icon-76x76-precomposed.png">
@jesgundy
jesgundy / log.js
Created March 6, 2018 16:21
Log Client Events
// log client side errors
window.onerror = function (message, url, lineNumber) {
// line number is useless since it is compiled
$.post(Kin.RootUrl + 'api/log/javascripterror', { message: message }, function (resp) {
});
return false; // continue to call the default handler
};
@jesgundy
jesgundy / getHTTPObject.js
Created September 13, 2012 15:08
Vanilla JS getHTTPObject AJAX request
// Reusable x-browser XMLHttpRequest
function getHTTPObject() {
var xhr = false;
if (window.XMLHttpRequest) {
xhr = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try {
xhr = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
@jesgundy
jesgundy / lodashify.js
Created November 28, 2017 21:15
to import lodash into chrome dev tools console
var el = document.createElement('script');
el.src = "https://cdn.jsdelivr.net/lodash/4.11.1/lodash.min.js";
el.type = "text/javascript";
document.head.appendChild(el);
// Use the following in a bookmarklet:
javascript:var el=document.createElement('script');el.src="https://cdn.jsdelivr.net/lodash/4.11.1/lodash.min.js";el.type = "text/javascript";document.head.appendChild(el);
@jesgundy
jesgundy / module-structure.js
Created November 29, 2012 18:53
Vanilla JS module structure
var MyModule = (function() {
var ModuleExport = function() {
// Do constructor stuff.
};
ModuleExport.prototype = {
doStuff: function( param ) {
// do stuff, then...
this.doOtherStuff();
@jesgundy
jesgundy / google-analytics-amd.js
Created August 19, 2016 17:41 — forked from ismyrnow/google-analytics-amd.js
Google Analytics AMD Module
define(function (require) {
var module;
// Setup temporary Google Analytics objects.
window.GoogleAnalyticsObject = "ga";
window.ga = function () { (window.ga.q = window.ga.q || []).push(arguments); };
window.ga.l = 1 * new Date();
// Immediately add a pageview event to the queue.