Skip to content

Instantly share code, notes, and snippets.

View kylehotchkiss's full-sized avatar
👨‍💻
Javascript

Kyle Hotchkiss kylehotchkiss

👨‍💻
Javascript
View GitHub Profile
@kylehotchkiss
kylehotchkiss / database.js
Created March 7, 2013 14:56
Here's a Node.JS-CouchDB wrapper.
/**
*
* fnstraj | Simple CouchDB Wrapper
* Copyright 2011-2013 Kyle Hotchkiss
* Released under the GPL
*
* Needs checkup (HEAD) check to verify that we're good to
* continue forward with Daemon execution.
*
*/
@kylehotchkiss
kylehotchkiss / flight.json
Created March 24, 2013 19:01
How long would this take to table-ize?
{
"_id" : "1363975475",
"_rev" : "1-b4dab98ce01f55526c19733988982552",
"analysis" : {
"points" : {
"burst" : {
"index" : 57,
"latitude" : 37.43120734417338,
"longitude" : -78.55404367043889,
"altitude" : 32747.3439370399
@kylehotchkiss
kylehotchkiss / wp-config-additions.php
Last active December 16, 2015 19:29
Wordpress Config Addendum for hosting locally and hosting on Appfog.
<?php
///////////////////////////////////
// Local and Production Settings //
///////////////////////////////////
if ( strpos( $_SERVER['SERVER_NAME'], ".dev" ) ) {
/////////////////////////////
// Development / Localhost //
/////////////////////////////
define('DB_NAME', '');
@kylehotchkiss
kylehotchkiss / .htaccess
Created April 29, 2013 22:45
.htaccess for Wordpress on Appfog Uses a bunch (but not all) of HTML5 Boilerplate's .htaccess code.
##
## Wordpress Redirects:
##
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
{
"_id" : "1361639151",
"_rev" : "1-44fc5784a1232a8105674a8dc9bcf629",
"analysis" : {
"heading" : 111.6373011593165,
"distance" : 173.6348318055695,
"midpoint" : {
"longitude" : -78.26637652371045,
"latitude" : 37.05637464459874
}
@kylehotchkiss
kylehotchkiss / pagination.html
Created August 30, 2013 04:51
What's that? You're using Jekyll and Foundation together? Cool, here's how to make pagination work:
<div class="pagination-centered">
<ul class="pagination">
{% if paginator.previous_page %}
{% if paginator.previous_page == 1 %}
<li class="arrow"><a href="/" class="arrow">&laquo;</a></a>
{% else %}
<li class="arrow"><a href="/blog/page/{{ paginator.previous_page }}" class="arrow">&laquo;</a></li>
{% endif %}
{% else %}
<li class="arrow unavailable"><a href="#">&laquo;</a></li>
@kylehotchkiss
kylehotchkiss / likecounter.js
Created November 19, 2013 04:11
A crude Instagram hashtag like calculator. Theoretically can grab up to 100,000 pics of likes (an hour), given Instagram's API throttling. It's not 100% reflective of all images in a hashtag, Instagram doesn't return full data sets. But it can report averages and project a total, if that's useful to ya. Get your own access key and try it out.
var request = require("request");
var moment = require("moment");
var access_token = '';
var getTotalLikes = function( hashtag, callback ) {
var realCount;
var totalLikes = 0;
var totalImages = 0;
@kylehotchkiss
kylehotchkiss / gruntfile-stuff.js
Created April 27, 2014 04:41
CDNify for Grunt/Wordpress - Failsafe code for conditionally using versioned CDN'd assets with wordpress, fails back to local files.
md5: {
compile: {
files: {
'<%= config.tmp %>/styles/': '<%= config.wordpress %>/**/*.css',
'<%= config.tmp %>/scripts/': '<%= config.wordpress %>/**/*.js'
},
options: {
keepBasename: true,
keepExtension: true,
after: function ( changes ) {

Keybase proof

I hereby claim:

  • I am kylehotchkiss on github.
  • I am kylehotchkiss (https://keybase.io/kylehotchkiss) on keybase.
  • I have a public key whose fingerprint is 0E64 19C9 F67E 7C4D 264D 4CC8 3DE4 9D15 999F F849

To claim this, I am signing this object:

@kylehotchkiss
kylehotchkiss / chase.js
Last active August 29, 2015 14:05
Get total of Chase rewards for next statement, because chase doens't tell you.
var transactions = [];
var i = 0;
jQuery(".summary a.expander").each(function( i ) {
transactions.push( this );
});
var getTransactions = (function getTransactions() {
if ( i < transactions.length ) {