Skip to content

Instantly share code, notes, and snippets.

View jkeam's full-sized avatar
🍻

Jon Keam jkeam

🍻
View GitHub Profile
@jkeam
jkeam / calendar.html
Created February 4, 2014 20:56
jQuery UI Datepicker
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Select a Date Range</title><title>jQuery UI Datepicker - Select a Date Range</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script type='text/javascript'>
/*Any variables set outside of your function are known as global variables, which can be used in any function. Here, outside of your main function, I'm setting a global variable for $minDate, a variable that will represent the Start Date and a variable for $maxDate, the variable that will represent the End Date.*/
@jkeam
jkeam / nesting
Created February 4, 2014 21:06
Less Nesting
.jon_container {
float: left;
color: #323a13;
.border(1px,#afc945);
.gradient(#afc945, #c8da64);
.common;
span {
.my-span;
.border-dashed(1px,rgba(255,255,255,0.3));
}
@jkeam
jkeam / single_bootstrap.css
Created October 16, 2012 19:46
Twitter Bootstrap all in one file
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section {
@jkeam
jkeam / fix_eclipse_proj_references.sh
Created March 15, 2013 14:06
Script I used locally to fix my eclipse project references.
#!/bin/bash
(
#directory to cd into
#/cygdrive/f/blah
directory=$1
#suffix to add to .project and .classpath
#1.0-SNAPSHOT
suffix=$2
@jkeam
jkeam / promise.js
Last active February 19, 2016 01:52
Promises
'use strict';
const http = require('https');
function docs() {
console.log('The Promise object is used for deferred and asynchronous computations. A Promise represents an operation that hasn\'t completed yet, but is expected in the future.');
console.log("pending: initial state, not fulfilled or rejected.\n fulfilled: meaning that the operation completed successfully.\n rejected: meaning that the operation failed.");
console.log('Great notes from Mozilla: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise');
}
function takesLongTime(url, resolve, reject) {
### Keybase proof
I hereby claim:
* I am jkeam on github.
* I am jonnyman9 (https://keybase.io/jonnyman9) on keybase.
* I have a public key whose fingerprint is 4430 D491 0B7F 1EAF 65E5 3645 99A2 EF07 7123 9327
To claim this, I am signing this object:
#!/bin/bash
# I live in Arlington so default it there :)
value=${1:-22209}
curl -4 http://wttr.in/$value
@jkeam
jkeam / gist:a8efc00c016b1f31f07aafb18a7fe9b1
Created February 17, 2017 06:10 — forked from sebboh/gist:f1dfe4f096746c45f3e9ea06a09743a0
Installing a Gem on Heroku from a Private GitHub Repo

Installing a Gem on Heroku from a Private GitHub Repo

Sometimes you want to use a gem on Heroku that is in a private repository on GitHub.

Using git over http you can authenticate to GitHub using basic authentication. However, we don't want to embed usernames and passwords in Gemfiles. Instead, we can use authentication tokens.

This method does not add your OAuth token to Gemfile.lock. It uses bundle config to store your credentials, and allows you to configure Heroku to use environment variables when deploying.

  1. Generate an OAuth token from GitHub
@jkeam
jkeam / gist:fdda2557ee2a28881f5a33356391f42c
Created February 17, 2017 06:10 — forked from sebboh/gist:f1dfe4f096746c45f3e9ea06a09743a0
Installing a Gem on Heroku from a Private GitHub Repo

Installing a Gem on Heroku from a Private GitHub Repo

Sometimes you want to use a gem on Heroku that is in a private repository on GitHub.

Using git over http you can authenticate to GitHub using basic authentication. However, we don't want to embed usernames and passwords in Gemfiles. Instead, we can use authentication tokens.

This method does not add your OAuth token to Gemfile.lock. It uses bundle config to store your credentials, and allows you to configure Heroku to use environment variables when deploying.

  1. Generate an OAuth token from GitHub
@jkeam
jkeam / zoos_and_animals.viz
Created March 22, 2017 20:38
Zoos and Animals
digraph SimplestDiagrams {
Zoo1
"Zoo1" -> "Cat"
"Zoo1" -> "Dog"
Zoo2
"Zoo2" -> "Cat"
"Zoo2" -> "Crow"
Zoo3