Skip to content

Instantly share code, notes, and snippets.

Benjamin Fagin UnquietCode

Block or report user

Report or block UnquietCode

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
View Keybase.md

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 Jan 22, 2019
sum github issue labels
View 0-notes.md

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 Aug 16, 2017
generate AWS SES email credentials in Python
View ses.py
# 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 Apr 19, 2015
Lava Lamp Random Number Generator
View Lava Lamp RNG.md

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 Jul 25, 2017
Merge two or more JSON objects in JavaScript (CoffeeScript).
View JsonMerge.coffee
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 Aug 29, 2015
gulp-browatchify test
View A.js
var B = require('./B');
console.log("hello");
@UnquietCode
UnquietCode / MapperModule.java
Last active Apr 8, 2019
Jackson module which can instantiate interface types using a proxy.
View MapperModule.java
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;
View gist:7596282
{
name: "Object"
version: "1"
parents: []
properties: {
name: "string"
version: "string"
parents: "string*"
properties: "object"
@UnquietCode
UnquietCode / API.java
Created Nov 14, 2013
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.
View API.java
public enum API {
@Deprecated Version1,
Version2(
add(Feature.BLUE_ICONS)
),
Version3(
parent(Version2),
@UnquietCode
UnquietCode / CustomRequestMappingHandlerMapping.java
Created Aug 23, 2013
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.
View CustomRequestMappingHandlerMapping.java
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;
You can’t perform that action at this time.