Skip to content

Instantly share code, notes, and snippets.

View jameslmartin's full-sized avatar

James Martin jameslmartin

View GitHub Profile
@jameslmartin
jameslmartin / gh_app_test.py
Created January 17, 2024 18:25
GitHub App Debugging
import time
import sys
import requests
import pprint
from jwt import jwk_from_pem, JWT
pem = 'path/to/your/private_key.pem'
app_id = '<your app ID>'
@jameslmartin
jameslmartin / iterm_profile.json
Created November 14, 2023 21:58
Exported "Transparent" profile from iTerm2
{
"Ansi 6 Color" : {
"Green Component" : 0.77254900000000004,
"Blue Component" : 0.99607840000000003,
"Red Component" : 0.77647060000000001
},
"Tags" : [
],
"Ansi 12 Color" : {
@jameslmartin
jameslmartin / graphql-reading-list.md
Last active October 4, 2023 20:21
GraphQL Reading List

GraphQL is an API technology developed by Facebook and released to the public in 2015

GraphQL background

In chronological order:

  1. Martin Fowler on the Richardson Maturity Model, 2010. Not specific to GraphQL but a good primer on API design.
  2. Lee Byron (Facebook) on GraphQL Core Principles / Exploring GraphQL, conference talk at react-europe 2015. I like watching conference talks at 1.25x or 1.5x speed.
  3. Apollo GraphQL reaches 1.0 in 2017, AppSync released. Skim 2017 in GraphQL on the Apollo Blog, not a ton of useful info but 2017 was a landmark year for GraphQL adoption
  4. Apollo introduces Federation, allowing data to be stitched together from subgraphs
@jameslmartin
jameslmartin / nginx-config-update.md
Last active September 16, 2021 16:13
Installing nginx from Source

Installing nginx from Source

Following these instructions.

I would recommend using Ubuntu 18.04 LTS, specifically for certbot (which you will need for SSL). Certbot does not currently support 19.10.

Before installing pre-reqs (pre-pre-reqs)

Ensure that your system is up to date with apt-get update

Keybase proof

I hereby claim:

  • I am jameslmartin on github.
  • I am jlmartin (https://keybase.io/jlmartin) on keybase.
  • I have a public key ASBsqyVy6qQWX-ZI2UfHi7SlVmf-z9oq9alGmxEOTsI6igo

To claim this, I am signing this object:

@jameslmartin
jameslmartin / app.js
Created February 15, 2016 20:05
Small node app for serving files
function p(d) {
console.log(d);
}
var express = require('express');
var app = express();
app.use(express.static(__dirname + '/'));
var server = app.listen('9999', function() {
@jameslmartin
jameslmartin / reader.js
Last active July 19, 2016 10:00
reader, a Jupyter Notebook nbextension that provides audio cues for visually impaired users
/*
* Author: James Martin (jamesml@cs.unc.edu)
*/
define(function() {
"use strict";
var Jupyter = require('base/js/namespace');
var events = require('base/js/events');
@jameslmartin
jameslmartin / emacspeak.md
Last active February 8, 2016 20:23
Emacspeak Installation

Following these instructions. Note that emacspeak does not work with the Apple shipped version of emacs, so we install emacs local to the user with brew.

Use brew, note that --cocoa is deprecated, use --with-cocoa instead. This step will take a while, as emacs is installed.
brew install emacs --HEAD --use-git-head --with-cocoa --srgb
brew linkapps emacs
mkdir -p ~/Sources
cd ~/Sources
git clone https://github.com/tvraman/emacspeak.git
cd ~/Sources/emacspeak

@jameslmartin
jameslmartin / bad-example.java
Last active August 29, 2015 14:23
Bad example
// Retrieve keyword information
keywords = retrieveRawKeywordInformation(json);
if(keywords.path("keywords") != null &&
!(keywords.path("keywords") instanceof MissingNode) &&
!(keywords.path("keywords").toString().equals("{}"))){
...}
@jameslmartin
jameslmartin / example.java
Last active August 29, 2015 14:23
Example
// Retrieve raw information, then actually path into the object
keywords = retrieveRawKeywordInformation(json);
keywords = keywords.path("keywords");
if(keywords != null &&
!(keywords instanceof MissingNode) &&
!(keywords.toString().equals("{}"))){
...}