Skip to content

Instantly share code, notes, and snippets.

View UnquietCode's full-sized avatar

Benjamin Fagin UnquietCode

View GitHub Profile

Keybase proof

I hereby claim:

  • I am unquietcode on github.
  • I am unquietcode (https://keybase.io/unquietcode) on keybase.
  • I have a public key ASDL4ha8bU25uQvATXGnhAGcrJKFfk_Khbcbs9QUZLCEbgo

To claim this, I am signing this object:

@UnquietCode
UnquietCode / 0-notes.md
Last active January 22, 2019 23:32
sum github issue labels

Bookmarklet Usage

  1. copy the bookmarklet code below
  2. create a new bookmark with the code as the URL
  3. navigate to an issues listing view in GitHub, like a milestone view
  4. click the bookmark, an alert box will show you the results

Script Usage

  1. navigate to an issues listing view in GitHub, like a milestone view
  2. copy the code snippet
  3. open the browsers JavaScript developer console on the page
@UnquietCode
UnquietCode / ses.py
Created August 16, 2017 21:09
generate AWS SES email credentials in Python
# based on:
# https://charleslavery.com/notes/aws-ses-smtp-password-from-secret-key-python.html
import hashlib
import hmac
import base64
key = bytes('aws-secret-access-key').encode('utf-8')
message = bytes('SendRawEmail').encode('utf-8')
@UnquietCode
UnquietCode / Lava Lamp RNG.md
Created April 19, 2015 18:52
Lava Lamp Random Number Generator

Lava Lamp Random Number Generator

(extracted from the now defunct SGI project at http://lavarand.sgi.com/cgi-bin/how.cgi via the magical Internet Archive Wayback Machine)

Lava Lamps can be used as a source of randomness, which can be used to establish a random number generator. The output of the RNG can then be consumed by various computer applications.

Step 1: Establish a chaotic system

(Set up Lava Lite® lamps in a machine room.)

@UnquietCode
UnquietCode / JsonMerge.coffee
Last active July 25, 2017 15:05
Merge two or more JSON objects in JavaScript (CoffeeScript).
valueOrCopy = (obj) ->
if not obj
return undefined
else if obj instanceof Array
newObj = []
newObj.push(x) for x in obj
return newObj
else if (typeof obj).toLowerCase() is 'object'
@UnquietCode
UnquietCode / A.js
Last active August 29, 2015 14:07
gulp-browatchify test
var B = require('./B');
console.log("hello");
@UnquietCode
UnquietCode / MapperModule.java
Last active April 8, 2019 19:06
Jackson module which can instantiate interface types using a proxy.
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.Version;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.deser.Deserializers;
import com.fasterxml.jackson.databind.node.ObjectNode;
import java.io.IOException;
import java.util.Iterator;
{
name: "Object"
version: "1"
parents: []
properties: {
name: "string"
version: "string"
parents: "string*"
properties: "object"
@UnquietCode
UnquietCode / API.java
Created November 14, 2013 19:49
Keep track of your API in your code. This also allows you to easily identify places in your application where legacy blocks ('hacks') can be removed.
public enum API {
@Deprecated Version1,
Version2(
add(Feature.BLUE_ICONS)
),
Version3(
parent(Version2),
@UnquietCode
UnquietCode / CustomRequestMappingHandlerMapping.java
Created August 23, 2013 20:32
Custom implementation of Spring's RequestMappingHandlerMapping which automatically registers a redirect for the same url with (or without) a trailing slash. This is good in cases where for SEO purposes you want 'url' and 'url/' to resolve to the same page.
package com.sb.server.web;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.http.HttpStatus;
import org.springframework.web.servlet.View;
import org.springframework.web.servlet.mvc.condition.PatternsRequestCondition;
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
import org.springframework.web.servlet.view.RedirectView;