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 / 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>
{
"_id" : "1361639151",
"_rev" : "1-44fc5784a1232a8105674a8dc9bcf629",
"analysis" : {
"heading" : 111.6373011593165,
"distance" : 173.6348318055695,
"midpoint" : {
"longitude" : -78.26637652371045,
"latitude" : 37.05637464459874
}
@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]
@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 / 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 / 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 / database.php
Last active December 12, 2015 05:08
Database interface functions in PHP.
<?php
/**
*
* fnstraj frontend | database wrapper
* Copyright 2011-2013 Kyle Hotchkiss
* Released under the GPL
*
* Aiming for API compatibility with fnstraj
* located at > fnstraj/library/database.js <
*
@kylehotchkiss
kylehotchkiss / coordsToLocation.js
Last active December 11, 2015 18:19
Easy coordinates-to-location-name via Google Maps API. You're welcome.
jQuery.getJSON("http://maps.googleapis.com/maps/api/geocode/json?address=" + latitude + ',' + longitude + "&sensor=true", function( data ) {
var components = data.results[0].address_components;
for ( level in components ) {
if (components[level].types[0] === "locality" || components[level].types[0] === "administrative_area_level_2" || components[level].types[0] === "administrative_area_level_1" ) {
locale = components[level].short_name;
break;
}
}
@kylehotchkiss
kylehotchkiss / worker.js
Created January 21, 2013 22:48
HOW NOT TO WRITE A DAEMON/QUEUE SYSTEM
/**
*
* FNSTraj | Worker Process
* Copyright 2011-2012 Hotchkissmade
* Released under the GPL
*
*/
var http = require("http");
var fnstraj = require("./predictors/fnstraj.js");
@kylehotchkiss
kylehotchkiss / midpoint.htm
Created December 15, 2012 17:42
Here's a coordinate midpoint calculator. Useful for displaying maps with lots of points... and centering them better?
<!DOCTYPE html>
<html>
<head>
<title>Coordinate Midpoint Calculator</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>
var RADIANS = Math.PI / 180;
var DEGREES = 180 / Math.PI;