Skip to content

Instantly share code, notes, and snippets.

James Harrison Fisher jameshfisher

Block or report user

Report or block jameshfisher

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jameshfisher
jameshfisher / stravaBug.js
Created Oct 13, 2018
Demonstration that Strava Route Builder can't find routes at the prime meridian
View stravaBug.js
// Open https://www.strava.com/routes/new, then copy/paste this code in the debug console.
// It should print results like this, showing that it can't find routes at the prime meridian:
//
// lng: -1.0, errCount: 0
// lng: -0.9, errCount: 0
// lng: -0.8, errCount: 1
// lng: -0.7, errCount: 0
// lng: -0.6, errCount: 0
// lng: -0.5, errCount: 0
// lng: -0.4, errCount: 0
View gctest.dats
(*
* to compile:
*
* $ patscc -DATS_MEMALLOC_LIBC gctest.dats
*
* NOTE: no GC here
*)
#include
"share/atspre_staload.hats"
View keybase.md

Keybase proof

I hereby claim:

  • I am jameshfisher on github.
  • I am jameshfisher (https://keybase.io/jameshfisher) on keybase.
  • I have a public key ASCYA1n1SBL09gPSYAODwLrEM29WPBhIc-z7hPGU5t2eIwo

To claim this, I am signing this object:

@jameshfisher
jameshfisher / 1gam.md
Last active Aug 29, 2015
One Game a Month plans
View 1gam.md

Non-Euclidean sokoban

Just like sokoban, except instead of being played on a 2d grid, it is played on graph-like structures with strange topologies (e.g. loops, mobius strips).

Randomness

Player must create as random a sequence as possible using the keyboard. Randomness is rewarded by pictures of random stuff.

@jameshfisher
jameshfisher / NonMonadicIO.hs
Created Jan 6, 2015
Non-monadic IO in Haskell
View NonMonadicIO.hs
module NonMonadicIO where
import GHC.Base (returnIO, bindIO)
-- The IO API:
--
-- returnIO :: a -> IO a
-- bindIO :: IO a -> (a -> IO b) -> IO b
-- Here's a program which does nothing:
@jameshfisher
jameshfisher / gist:77799ca0d96f5d475f1e
Created Dec 22, 2014
Elm: Wrong HTML element disappears in state transition
View gist:77799ca0d96f5d475f1e
<!DOCTYPE HTML>
<html><head><meta charset="UTF-8"><title>Compiled Elm</title><style>html,head,body { padding:0; margin:0; }
body { font-family: 'Lucida Grande','Trebuchet MS','Bitstream Vera Sans',Verdana,Helvetica,sans-serif; }
a {
color: #1184CE;
text-decoration: none;
}
a:hover {
text-decoration: underline;
color: rgb(234,21,122);
@jameshfisher
jameshfisher / splunk_enterprise_download_urls.md
Last active Aug 29, 2015
Splunk Enterprise download URLs
View splunk_enterprise_download_urls.md
NOT THIS: http://www.splunk.com/page/download_track?file=6.1.2/splunk/linux/splunk-6.1.2-213098-linux-2.6-x86_64.rpm
THIS:     http://download.splunk.com/products/splunk/releases/6.1.2/splunk/linux/splunk-6.1.2-213098-linux-2.6-x86_64.rpm

i.e. take the file argument and prefix it with http://download.splunk.com/products/splunk/releases/

Works for:

  • 6.1.2/splunk/linux/splunk-6.1.2-213098-linux-2.6-x86_64.rpm
  • 6.1.2/universalforwarder/linux/splunkforwarder-6.1.2-213098-linux-2.6-x86_64.rpm
  • ...
@jameshfisher
jameshfisher / restore-file-from-package.sh
Created Apr 12, 2014
Restore a file from the package that provides it.
View restore-file-from-package.sh
#!/bin/bash
# Usage:
#
# sudo ./restore-file-from-package.sh <filepath>
#
# Restore a file from the package that provides it.
#
# Source: http://askubuntu.com/a/67028/30482
@jameshfisher
jameshfisher / ORM_constraints.md
Last active Jan 4, 2016
ORM correctness constraints
View ORM_constraints.md

ORM correctness constraints

At an old workplace, we used the Hibernate ORM to map a class hierarchy to our relational database. Hibernate represents a class hierarchy in the following way. Let's say we have the tables:

abstract class A
class B extends A
class C extends A
View How to make a private Gist public.md

Github provides no facility to do this via the UI. This is sad, because it would be extremely useful in order to draft something before publishing it. It would also be trivial for them to implement. Never mind; here's how to do it manually:

  1. Get the "Clone this Gist" text from the left-hand side of the private Gist, e.g. https://gist.github.com/b9cc265982870c091a1e.git, and extract the ID b9cc265982870c091a1e.
  2. Go to https://gist.github.com/ and create a dummy new public Gist.
  3. Get the "Clone this Gist" text from the left-hand side, e.g. https://gist.github.com/8270253.git, and extract the ID 8270253.
  4. git clone git@gist.github.com:b9cc265982870c091a1e tmp-dir && cd tmp-dir && git push -f git@gist.github.com:8270253.git
You can’t perform that action at this time.