Instantly share code, notes, and snippets.

import java.util.Arrays;
public class Examples {
public static void main(String ... args) {
Solution s = new Solution();
System.out.print("Example problem: ");
System.out.println(s.shortest(3, 3,
Arrays.asList(1, 0, 0),
View hue.js
//An example of this can be seen at
function HueSegments(steps) {
var segments = []
var step
var increment = 200/steps
for(step = 0; step < steps; step++) {
segments.push("hsla("+(Math.floor(increment*step))+", 100%, "+(step % 2 == 0 ? "75" : "50")+"%, 1)")
return segments
View deepSet.js
function deepSet(keys, defaultValue) {
var keyNames = keys.split('.')
var out = defaultValue
var temp
var size = keyNames.length
var i
for (i = size - 1; i >= 0; i--) {
temp = out
out = {}
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.

Keybase proof

I hereby claim:

  • I am jasonsperske on github.
  • I am sperske ( on keybase.
  • I have a public key ASDulU5JtSD8n6FbUOUc-Ew2aEepk77hUZO8-pUPKWGyJAo

To claim this, I am signing this object:

View index.html
<!DOCTYPE html>
<meta http-equiv=content-type content="text/html;charset=UTF-8">
<title>GeoLocation Diagnostics</title>
<meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1">
<meta name=format-detection content="telephone=no">
<link href="" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script src="" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
View SendVictory.js
'use strict';
var https = require('https');
function fetchVictory(then, context, callback) {
var options = {
hostname: "",
port: 443,
path: "/random.json",
method: "GET"
View index.js
'use strict';
const algoliasearch = require('algoliasearch'),
path = require('path'),
striptags = require('striptags'),
settings = require('nconf').argv().env().file({file: '../settings.json'}).defaults(),
localizations = require('../content/localizations.json'),
base_path = path.join(__dirname, '..'),
utils = require('../fileCMS-utils')(base_path),
algolia_settings = settings.get('algolia'),
client = algoliasearch(, algolia_settings.key, function(err, message) {

While waiting for the Amazon AWS Status page to report on the actual status of S3 (US-EAST-1) I saw this tweet (

The dashboard not changing color is related to S3 issue. See the banner at the top of the dashboard for updates.

After seeing this I started working out a way to generate the page from Gulp with as few HTTP requests as possible and thus as few depeancies as possible. This is that attempt (with some guessees as to their schema for status information). I also took the opporunity to fix some invalid HTML on thier site while retianing as close as possible the look and feel of their original site (though with this approach

View example.cpp
#include <iostream>
using namespace std;
int main() {
int x;
int y;
while(cin >> x >> y) {
cout << "x:" << x << " y:" << y << "\n";
return 0;