Skip to content

Instantly share code, notes, and snippets.

View Kirkman's full-sized avatar

Josh Renaud Kirkman

View GitHub Profile
@stucka
stucka / bing-test.ipynb
Created January 31, 2024 17:41
Get Bing's cached version of a URL
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jgravois
jgravois / hub_v3_search_api_ref.md
Created February 5, 2019 19:37
Hub v3 Search API doc port (February 5th, 2019)
@nrollr
nrollr / ApacheHTTPSConfig.md
Last active March 11, 2024 13:32
Enable SSL in Apache for 'localhost' (OSX, El Capitan)

Enable SSL in Apache (OSX)

The following will guide you through the process of enabling SSL on a Apache webserver

  • The instructions have been verified with OSX El Capitan (10.11.2) running Apache 2.4.16
  • The instructions assume you already have a basic Apache configuration enabled on OSX, if this is not the case feel free to consult Gist: "Enable Apache HTTP server (OSX)"

Apache SSL Configuration

Create a directory within /etc/apache2/ using Terminal.app: sudo mkdir /etc/apache2/ssl
Next, generate two host keys:

@jeremyjbowers
jeremyjbowers / draft.py
Created May 9, 2014 00:36
This will run every 5 seconds and update NFL draft information. Requires requests.
#!/usr/bin/env python
import datetime
import threading
import time
import requests
def request_draft_info():
threading.Timer(5, request_draft_info).start();
@vectorsize
vectorsize / linearScale.js
Last active December 20, 2022 14:30
Quick linear scale inspired by d3.js scales, based on the processing.org map() function.takes in an object with a domain array and a rage array, gives you back a function that receives a value and returns the scaled value.
// based on https://github.com/processing/processing/blob/a6e0e227a948e7e2dc042c04504d6f5b8cf0c1a6/core/src/processing/core/PApplet.java#L5093
var scale = function(opts){
var istart = opts.domain[0],
istop = opts.domain[1],
ostart = opts.range[0],
ostop = opts.range[1];
return function scale(value) {
return ostart + (ostop - ostart) * ((value - istart) / (istop - istart));
@mbostock
mbostock / .block
Last active July 1, 2023 06:53
Merging States
license: gpl-3.0
@pamelafox
pamelafox / showspreadsheet.php
Created January 8, 2011 05:47
PHP for parsing the JSON output a published Google spreadsheet and displaying columns from each row.
<?php
// Parsing this spreadsheet: https://spreadsheets.google.com/pub?key=0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc&hl=en&output=html
$url = 'http://spreadsheets.google.com/feeds/list/0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc/od6/public/values?alt=json';
$file= file_get_contents($url);
$json = json_decode($file);
$rows = $json->{'feed'}->{'entry'};
foreach($rows as $row) {
echo '<p>';
@schwanksta
schwanksta / apdate_to_datetime.py
Created May 5, 2010 00:10
Converts an AP Style date string to a Python datetime object.
def apdate_to_datetime(date):
"""
Takes an AP-formatted date string and returns a Python datetime
object. This will also work on any date formatted as either
'%b. %d, %Y' or '%B %d, %Y'
Examples:
>>> apdate_to_datetime("Sept. 4, 1986")
datetime.datetime(1986, 9, 4, 0, 0)
>>> apdate_to_datetime("Sep. 4, 1986")