Skip to content

Instantly share code, notes, and snippets.

View kjantzer's full-sized avatar
👨‍💻
Likely writing JavaScript

Kevin Jantzer kjantzer

👨‍💻
Likely writing JavaScript
View GitHub Profile
@kjantzer
kjantzer / commit-msgs-since-last-tag.sh
Created September 2, 2014 15:24
Get a compiled list of commit messages since the latest tag. Make sure to change the `GIT_ROOT` variable.
#!/bin/bash
GIT_ROOT='/Users/{username}/Sites/my-git-repo/'
cd $GIT_ROOT
LAST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
echo $LAST_TAG
@kjantzer
kjantzer / previous-git-tag.sh
Created March 2, 2015 20:01
Get Previous Git Tag (the one before the latest tag)
# http://stackoverflow.com/a/28818420/484780
git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`
/*
Convert numbers to words
copyright 25th July 2006, by Stephen Chapman http://javascript.about.com
permission to use this Javascript on your web page is granted
provided that all of the code (including this copyright notice) is
used exactly as shown (you can change the numbering system if you wish)
*/
var numberToWords = function(s){
@kjantzer
kjantzer / DB.php
Created November 30, 2012 15:49
PHP MySQL Database Class
<?php
/*
Database Class
this class should be extended (see DBCore.php) to be made
into a singleton class
@author Kevin Jantzer, Blackstone Audio Inc.
@since 2012-04-20
@kjantzer
kjantzer / FilterView.js
Last active October 22, 2021 20:41
Backbone.js: FilterView – extendable View for adding filtering/searching to a view
/*
FilterView
@author Kevin Jantzer, Blackstone Audio Inc.
@since 2012-11-06
Filter by Presets and user typed Terms. If filtered by a preset,
search term will filter within the preset filtered collection
USE:
@kjantzer
kjantzer / InfiniteListView.js
Last active October 22, 2021 20:41
Backbone.js: Infinite Scrolling List View
/*
Infinite List View
creates <ul> with triggers for infinite scrolling
@author Kevin Jantzer, Blacktone Audio Inc.
@since 2012-11-06
USE - listen for:
@kjantzer
kjantzer / PubSub.js
Created September 10, 2012 20:37
PubSub.js - Simple Publish/Subscribe "Class"
/*
Lightweight PUBLISH / SUBSCRIBE Class
Original code from: <http://blog.bobcravens.com/2011/01/loosely-coupled-javascript-using-pubsub/>
Can be initialized on other Objects to provide pub/sub functionality within that object
ex: this.events = new PubSub();
*/
@kjantzer
kjantzer / README.md
Last active November 26, 2020 13:23
Create a GIF from Alfred App

Install Dependencies

$ brew install ffmpeg
$ brew install gifsicle
@kjantzer
kjantzer / remove-wp-admin-header.php
Last active May 29, 2019 19:21
Globally remove default WordPress Admin Header. Courtesy of David Walsh (http://davidwalsh.name/remove-wordpress-admin-bar-css)
add_action('get_header', 'remove_admin_login_header');
function remove_admin_login_header() {
remove_action('wp_head', '_admin_bar_bump_cb');
}
@kjantzer
kjantzer / Plural.js
Last active May 1, 2019 11:47
JavaScript: Plural - create a plural or singluar sentence based on a number
/*
Plural - create singlular or plural sentence based on number given (all numbers but 1 return plural sentence)
var str = "Do you want to delete this? There {are|is} [num] book{s} attached."
var num = 2 // or 0, 3, 4, ...
"Do you want to delete this? There are 2 books attached."
var num = 1
"Do you want to delete this? There is 1 book attached."