Skip to content

Instantly share code, notes, and snippets.

View moorage's full-sized avatar

Matthew Moore moorage

View GitHub Profile
@moorage
moorage / google_cloud_storage_multiple_file_zip.go
Last active June 28, 2018 05:24
Zip all the google cloud storage files with a prefix, and upload it back into the prefix.
var StorageBucket string // google storage bucket name
var PrefixToZip string // the prefix you want to zip
var ArchiveZipFilename string // the ultimate name of the zipfile, e.g. archive.zip
var GoogleCloudClientOption option.ClientOption // can load creds from a json file with this, e.g. GoogleCloudClientOption = option.WithCredentialsFile(jsonFile)
var LogContext string // additional logging string
// Download all files & zip (named ArchiveZipFilename) from gcloud prefix (PrefixToZip)
func main() {
@moorage
moorage / fetch_github_primary_email.rs
Last active May 28, 2018 19:07
Easy function to call to fetch the primary email address of a user in Rust.
// Example usage:
// let github_email = fetch_github_primary_email(&some_access_token)?;
//
// Cargo.toml:
// ..
// [dependencies]
// rocket = "0.3.11"
// curl = "0.4"
// serde = "1.0"
// serde_json = "1.0"
@moorage
moorage / github_graphql.rs
Created May 27, 2018 20:11
Easy function to call GitHub's GraphQL server in Rust.
// Example usage:
// let github_details = github_graphql_query(
// &"some_oauth_access_token",
// &"query { viewer { email name login id location websiteUrl } }",
// )?;
//
// Cargo.toml:
// ..
// [dependencies]
// rocket = "0.3.11"
@moorage
moorage / bounding-boxes-darknet.diff
Created June 5, 2017 14:18
The diff for darknet to output bounding boxes. I'm using the command: `./darknet detect cfg/yolo.cfg yolo.weights ~/Desktop/color_31.jpg`
diff --git a/examples/detector.c b/examples/detector.c
index 0a31fc2..5764567 100644
--- a/examples/detector.c
+++ b/examples/detector.c
@@ -364,7 +364,7 @@ void validate_detector_flip(char *datacfg, char *cfgfile, char *weightfile, char
if(fps) fclose(fps[j]);
}
if(coco){
- fseek(fp, -2, SEEK_CUR);
+ fseek(fp, -2, SEEK_CUR);

Keybase proof

I hereby claim:

  • I am moorage on github.
  • I am mattmoore (https://keybase.io/mattmoore) on keybase.
  • I have a public key whose fingerprint is FEF6 302D 2C55 397C 0F6B 0757 1367 2E91 63F6 628A

To claim this, I am signing this object:

@moorage
moorage / main.cpp
Created March 2, 2016 05:59
Collect side-by-side stereovision video and image captures with openCV in C++
//
// main.cpp
// OpenCVTest
//
// Created by ThriveSmart One on 2/29/16.
// Copyright © 2016 ThriveSmart One. All rights reserved.
//
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>

A smart creative has deep technical knowledge in how to use the tools of her trade[^18], and plenty of hands-on experience. In our industry, that means she is most likely a computer scientist, or at least under- stands the tenets and structure of the systems behind the magic you see on your screens every day. But in other industries she may be a doctor, designer, scientist, filmmaker, engineer, chef, or mathematician. She is an expert in doing. She doesn't just design concepts, she builds prototypes.

She is analytically smart. She is comfortable with data and can use it to make decisions. She also understands its fallacies and is wary of endless analysis. Let data decide, she believes, but don't let it take over.

She is business smart. She sees a direct line from technical expertise to product excellence to business success, and understands the value of all three.

She is competitive smart. Her stock-in-trade starts with innovation, but it also includes a lot of work. She is driven to be great, and tha

@moorage
moorage / go(lang)-for-fun-and-profit-slides.html
Last active August 29, 2015 14:13
Talk given at AdRoll, SF HQ - January 2015
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>In Introduction to Go(lang) for Programmers</title>
<script>
(function(d,ua){
if ((ua.indexOf('chrome') > -1) || (ua.indexOf('safari') > -1 && ua.indexOf("mobile") === -1)) {
d.className += " supported ";
@moorage
moorage / top500.go
Created January 13, 2015 09:28
Top 500 website urls, in a go array
urls := []string{"google.com", "youtube.com", "facebook.com", "msn.com", "twitter.com", "microsoft.com", "amazon.com", "yelp.com", "yahoo.com", "buzzfeed.com", "ebay.com", "pinterest.com", "bing.com", "wikipedia.org", "wikia.com", "weather.com", "live.com", "paypal.com", "wordpress.com", "blogger.com", "playbuzz.com", "about.com", "diply.com", "linkedin.com", "adobe.com", "blogspot.com", "bleacherreport.com", "craigslist.org", "godaddy.com", "wayfair.com", "aol.com", "whitepages.com", "urbandictionary.com", "nydailynews.com", "sbnation.com", "ask.com", "nbcnews.com", "walmart.com", "vimeo.com", "inquisitr.com", "norton.com", "drugs.com", "ijreview.com", "usmagazine.com", "go.com", "legacy.com", "imgur.com", "ibtimes.com", "comcast.net", "thoughtcatalog.com", "wellsfargo.com", "zergnet.com", "opposingviews.com", "stackexchange.com", "mozilla.org", "target.com", "babycenter.com", "uproxx.com", "dose.com", "ibm.com", "goodreads.com", "apple.com", "upworthy.com", "bustle.com", "nbcsports.com", "theblaze.com", "to
@moorage
moorage / opencv-xphoto-howto.md
Last active March 8, 2019 17:01
How I built xphoto module into opencv-3.0.0