Skip to content

Instantly share code, notes, and snippets.


Michael Dowling mtdowling

  • Amazon Web Services
  • Seattle, WA
View GitHub Profile
mtdowling /
Created Apr 10, 2019
Module Graph example
package com.example;
import java.lang.module.ModuleDescriptor;
import java.lang.module.ModuleFinder;
import java.lang.module.ModuleReference;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayDeque;
mtdowling / can_json_decode.php
Created Mar 29, 2017
Check if a value can be json_decoded
View can_json_decode.php
function try_json_encode($data)
return (json_last_error() == JSON_ERROR_NONE);
function json_encode_type_check($data)
mtdowling / MovementSystem.lua
Created Feb 8, 2017
A slice of some of my collision rounding code
View MovementSystem.lua
local ecs = require "ecs"
local collision = require "collision"
local components = require "components"
local utils = require "utils"
local clamp = lume.clamp
--- Updates entity physics.
local MovementSystem = ecs.createSystem("Movement", "pos", "motion")
mtdowling / react-guzzle.php
Created Sep 9, 2015
React, Guzzle, and AWS SDK for PHP integration
View react-guzzle.php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Psr7\Response;
use React\EventLoop\Factory;
use WyriHaximus\React\GuzzlePsr7\HttpClientAdapter;
$loop = Factory::create();
View gist:78560b586e39ab586bf0
// Generic middleware that does not have to create a response.
$ringStyle = function(RequestInterface $request, callable $next) {
$request = $request->withHeader('Foo', 'Bar');
$response = $next($request);
$response = $response->withHeader('Baz', 'Bam');
return $response;
mtdowling / gist:47da5eab54337cdc7ecc
Last active Aug 29, 2015
React and Guzzle experiment
View gist:47da5eab54337cdc7ecc
require 'vendor/autoload.php';
use GuzzleHttp\Stream\BufferStream;
use GuzzleHttp\Stream\AsyncReadStream;
use GuzzleHttp\Ring\Future;
$loop = React\EventLoop\Factory::create();
$dnsResolverFactory = new React\Dns\Resolver\Factory();
$dnsResolver = $dnsResolverFactory->createCached('', $loop);
mtdowling / diff.diff
Last active Aug 29, 2015
Sami static templates
View diff.diff
diff --git a/README.rst b/README.rst
index d7f7d17..cb1961d 100644
--- a/README.rst
+++ b/README.rst
@@ -200,6 +200,9 @@ the default theme:
'js/bootstrap.min.js': 'js/bootstrap.min.js'
'js/jquery-1.11.1.min.js': 'js/jquery-1.11.1.min.js'
+ static_templates:
+ 'api_tree': 'layout/api_tree.twig'
View gist:9b613158fe894e35715b
$ wget
--2014-08-22 17:23:24--
Connecting to||:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: [following]
--2014-08-22 17:23:30--
Connecting to|10
mtdowling /
Last active Aug 29, 2015
Test installer
#!/usr/bin/env bash
set -e
[ -z "$CHAG_DIR" ] && CHAG_DIR="/usr/local/bin"
[ -z "$CHAG_VERSION" ] && CHAG_VERSION="master"
echo "=> Downloading chag to '$CHAG_DIR'"
View gist:64576e019c9b5f869e5b
### Keybase proof
I hereby claim:
* I am mtdowling on github.
* I am mtdowling ( on keybase.
* I have a public key whose fingerprint is C660 D8CE AE59 6DDF CE43 8F4C B48A B84B 28DB 4EF7
To claim this, I am signing this object: