Skip to content

Instantly share code, notes, and snippets.

View nrktkt's full-sized avatar

Nathan Fischer nrktkt

View GitHub Profile
@nrktkt
nrktkt / words.md
Last active March 11, 2016 00:01

On What Computer Science Is and Is Not, What Software Engineering Is, The Framework Fear, The Web Developer and The Council

So I'm going to go ahead and dive headfirst into the shitpile wearing nothing but my arrogance. If nothing else, skip to The Council

<rant>

What Computer Science is

Computer science is a huge field comprised of both theoretical

Clinton Email Summary (taken from FBI report):

TL;DR: It is a felony to mishandle classified information either intentionally or in a grossly negligent way. Hillary Clinton transmitted, stored and discussed top-secret classified information on a personal, unclassified system. There is evidence to support that she did so knowingly. Some of this information likely fell into the hands of malicious actors. The FBI does not recommend prosecuting. Most individuals in this situation would likely face non-criminal consequences, but those are outside the scope of the FBI.

Our investigation looked at whether there is evidence classified information was improperly stored or transmitted on that personal system, in violation of a federal statute making it a felony to mishandle classified information either intentionally or in a grossly negligent way, or a second statute making it a misdemeanor to knowingly remove classified information from appropriate systems or storage facilities.


@nrktkt
nrktkt / maven-cd.md
Last active August 9, 2016 05:52
From 0 to continuous deployment to maven central

Complete guide to continuous deployment to maven central from Travis CI

Continuous deployment is a very useful tool for open source projects. The people accepting pull requests in an open source project may not all have the permissions or skills to also deploy those changes, but continuous deployment offers them a way around that. Once code is accepted into the master branch, that code is deployed automatically. This allows individuals deploying pull requests to add agile features and make bug fixes without taking up too much time.

This guide will take your maven library project from creation and local installation to creation and code-signing in the cloud, where it is then deployed to maven central. We make a few assumptions about your starting point:

Keybase proof

I hereby claim:

  • I am kag0 on github.
  • I am nfischer (https://keybase.io/nfischer) on keybase.
  • I have a public key whose fingerprint is ACEE 7076 E84C 067F DC50 FE58 E8EE 9D77 9BBC 7C30

To claim this, I am signing this object:

@nrktkt
nrktkt / jwc.md
Last active August 13, 2016 03:04

Abstract

JSON Web Certificate (JWC) is a compact means of representing an association between an identity and a (JSON Web Key) JWK signing key. The claims in a JWC are encoded as a JSON object that is used as the payload of a JSON Web Signature (JWS) structure, enabling the claims to be digitally signed with an associated JWK.

JOSE Header

typ

Should be JWC

Hypermedia APIs in Play! framework with the blackdoor hate library

REST APIs are all the rage. They make web services easier and simpler to use. However, most REST APIs are not fully RESTfull or "mature". This is because they typically lack one thing, HATEOAS(Hypermedia As The Engine Of Application State). The most commonly cited reason for not creating hypermedia APIs is "it's too hard". It may indeed be hard sometimes if you're not sure what to do and the framework you're using doesn't have support built in.
But it doesn't have to be.
You can use the blackdoor hate library to easily produce hypermedia APIs any time, in any framework. Here we will walk through using the hate library to create a hypermedia API using play framework (which has no built in support) and JPA.

We will leave these first few sections rather sparse, since great documentation on setting

@nrktkt
nrktkt / sift4.java
Last active December 10, 2016 19:55
sift4 java
/**
* Sift4 - common version
* online algorithm to compute the distance between two strings in O(n)
* Algorithm by siderite, java port by Nathan Fischer 2016
* https://siderite.blogspot.com/2014/11/super-fast-and-accurate-string-distance.html
* @param s1
* @param s2
* @param maxOffset the number of characters to search for matching letters
* @return
*/
@nrktkt
nrktkt / api.html
Last active January 30, 2017 17:33
Google Wallet API
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Google Wallet API | Google Wallet Platform | Google Developers</title>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,400,400italic,500,500italic,700,700italic|Roboto+Mono:400,500,700|Material+Icons">
<link rel="stylesheet" href="https://developers.google.com/_static/a9bd1d6825/css/devsite-google-green.css" />
#!/usr/bin/env bash
icon="$HOME/.xlock/icon.png"
tmpbg='/tmp/screen.png'
(( $# )) && { icon=$1; }
scrot "$tmpbg"
convert "$tmpbg" -scale 5% -scale 2000% "$tmpbg"
# convert "$tmpbg" "$icon" -gravity center -composite -matte "$tmpbg"

maybeSQL

maybeSQL is the bastard child of SQL and noSQL.

Structure

Database

A maybeSQL database is a map from string table names to tables.

Table

A maybeSQL table is a collection of entries, as well as a set of named common properties that all entries may or may not have and a set of constraints on those properties that all entries must obey.

Entry

A maybeSQL entry is a set of key-value pairs, where values may be of a variety of data types. Values may also be tables of their own, although implementations of maybeSQL are not required to support relational constraints on these value-tables.

Property