Skip to content

Instantly share code, notes, and snippets.

View mattgen88's full-sized avatar

Matthew General mattgen88

View GitHub Profile
@mattgen88
mattgen88 / dev.Dockerfile
Created October 8, 2019 03:45
Dockerfile that automatically recompiles go application and then runs it on success
FROM golang:alpine as builder
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh
RUN mkdir /build
WORKDIR /build/
COPY . /build/
RUN go get

Day 1

Since I can't seem to catch Sir King off guard to snag his purse, I guess I'll follow the odd fellow around. We met up with a few of his other friends, a drinking buddy Aurum (who's sparkly... but not treasure), and Falune (who's feather, but definitely NOT a parrot).

Sir King, Aurum, Falune and I found ourselves a new prospect for some treasure! Some very poor guy sent us on an adventure. He didn't seem to have anything of worth. Plus, he seemed to be hanging around with the law. I gotta lay low while here in Phlan. This Doom guy is a bit of a drag, but talked of some Yip guy whose gone mad. We're going to check him out and see if he really is mad.

So, it turns out he is mad. Also, no one would let me dangle him out the window to be extra sure, nor could we convince Falune to drop him from the sky. Alas, though, he seems genuine. Talks of some Dracolich and a ghost ship. Personally, I'm not interested in coming face to face with a Dracolich, but a ghost ship might have treasure! Would it be gho

Keybase proof

I hereby claim:

  • I am mattgen88 on github.
  • I am mgeneral (https://keybase.io/mgeneral) on keybase.
  • I have a public key whose fingerprint is 9B87 7EF5 CE34 F230 6C87 5277 2352 5FD2 A6F1 17CF

To claim this, I am signing this object:

@mattgen88
mattgen88 / gist:7460299
Created November 14, 2013 02:29
not populating ng-repeat properly in 1.2.0-rc3
$scope.loadFeeds = function () {
$http.get('/api/feeds/?token=' + authsvc.getToken()).
success(function (data, status) {
$scope.feeds = data.data;
console.log(data);
}).
error(function (data, status) {
//wut
console.log('Unabled to retrieve feed list: ' + data);
});
@mattgen88
mattgen88 / gist:7460106
Created November 14, 2013 02:06
menu template for angular app not rendering properly in 1.2.0-rc3, worked in rc2
<div id="menu">
<div>
<a ng-click="loadAllContent()" class="btn btn-default btn-block">All Feeds</a>
<a ng-repeat="feed in feeds" ng-click="$parent.load(feed.2)" class="btn btn-default btn-block">{{feed.0}}</a>
<a ng-click="addFeed()" class="btn btn-default btn-block">+ Add Feed</a>
</div>
</div>
<div class="modal fade" id="feedadd">
<div class="modal-dialog">
<div class="modal-content">
@mattgen88
mattgen88 / gist:5703529
Created June 4, 2013 04:15
You'll never pass a dictionary that doesn't have anything other than strings and numbers to tornado's finish method. Why would you use it to return things like database entries from mongo containing BSON Object IDs or anything else for that matter. And of course you won't try and coerce it to a string automatically and just fail instead.
12 »···def finish(self, chunk=None):
13 »···»···def iterate(dictionary, comparator, mapping):
14 »···»···»···for key, value in dictionary.iteritems():
15 »···»···»···»···if isinstance(value, dict):
16 »···»···»···»···»···value = iterate(value, comparator, mapping)
17 »···»···»···»···else:
18 »···»···»···»···»···if comparator(value):
19 »···»···»···»···»···»···value = mapping(value)
20 »···»···»···»···dictionary[key] = value
21 »···»···»···return dictionary