Skip to content

Instantly share code, notes, and snippets.

View jessehattabaugh's full-sized avatar
🤠
pew pew

Jesse Hattabaugh jessehattabaugh

🤠
pew pew
View GitHub Profile
@jessehattabaugh
jessehattabaugh / index.js
Last active October 8, 2015 16:46
leaflet mosaic tiles
const YOUR_API_KEY = '8994b8108f2a4e4eba0b512942670f2c';
var L = require('leaflet');
var auth = require('arkanciscan-planet-client/api/auth');
auth.setKey(YOUR_API_KEY);
var mosaics = require('arkanciscan-planet-client/api/mosaics');
mosaics.get('color_balance_mosaic').then(function (data) {
@jessehattabaugh
jessehattabaugh / _fonts.styl
Last active August 29, 2015 14:13
Stylus Mixin for defining and using webfonts
/* Esplaination
****************************************************************************
This include represents a pattern for handling fonts which I have settled on after a lot of time
struggling to get fonts to render consistently across browsers. The jist of it is this; I don't
use font-weight or font-style. Instead I use a different font-family for each variation of the
font (ie. font-family: "FiraSans-Regular"; font-family: "FiraSans-BoldItalic"). The reason I do
this is that browsers don't always use the appropriate @font-face even when you declare them
with font-weight and font-size. This method allows me to control EXACTLY which font file is used.
*/
@jessehattabaugh
jessehattabaugh / gulpfile.js
Last active August 23, 2016 19:31
Gulp task for changing values in PhoneGap's config.xml file
/* Config - set the right values in the PhoneGap config.xml
******************************************************************************/
gulp.task('config', function () {
return gulp.src([srcDir + '/config.xml'])
.pipe(cheerio({
run: function ($) {
// get the version number from package.json
$('widget').attr('version', require('./package').version);
// in development launch the app with a different html file
@jessehattabaugh
jessehattabaugh / gist:5e3b31a0fc20598dff20
Last active August 29, 2015 14:02
gulp image compression task with gulp-watch
/* Images
******************************************************************************/
gulp.task('images', function() {
// batch mode
watch({glob: './source/images/*'})
.pipe(plumber())
.pipe(imagemin({
progressive: true,
interlaced: true
@jessehattabaugh
jessehattabaugh / helper.js
Created May 7, 2014 21:53
setsGets assertion helper for Chai
module.exports = function (chai, utils) {
var Assertion = chai.Assertion;
Assertion.addMethod('setsGets', function (val) {
var method = this._obj;
// setter/getters must be functions
new Assertion(method).to.be.a('function');
var gulp = require('gulp');
gulp.task('default', ['stylus']);
/* Stylus
-------------------------------------*/
var stylus = require('gulp-stylus');
var nib = require('nib');
gulp.task('stylus', function() {
return gulp.src('source/*.styl')
#!/usr/bin/env node
"use strict";
var fs = require('fs'),
gw = require('globwatcher').globwatcher;
var cssw = gw('./source/*.styl', {persistent: true});
cssw.on('added', function (filename) {
@jessehattabaugh
jessehattabaugh / DpzsG.markdown
Last active August 29, 2015 13:57
A Pen by Jesse Hattabaugh.
ul{
width: 300px;
margin: 100px auto;
}
li{
font-size: 1em;
list-style: none;
background-image: url('http://icons.iconarchive.com/icons/calle/smith-and-wesson/32/Single-Bullet-icon.png');
background-repeat: no-repeat;
<html><body>
<h1>Find a Unique Username</h1>
<p>With a limit of 15 characters</p>
<form method="get">
<label>First Name <input name="first_name" /></label>
<label>Last Name <input name="last_name" /></label>
<label>Quit after <input name="end" value="111" /></label>