Skip to content

Instantly share code, notes, and snippets.

View moorage's full-sized avatar

Matthew Moore moorage

View GitHub Profile
@moorage
moorage / bash_profile
Created December 13, 2014 21:42
rvm and git and directory in bash_profile
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
### BEGIN: history bash shell useful settings ###
export HISTCONTROL=ignoredups # Ignores dupes in the history
shopt -s checkwinsize # After each command, checks the windows size and changes lines and columns
@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 / 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 ";

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 / email-sanitizer.go
Last active December 18, 2015 23:29
Have you ever needed to clean email addresses out of a file (like a SQL Dump) so that you don't accidentally email people in it? This script does exactly that! It turns all email addresses in the file into developers+EMAILADDRESS@example.com
package main
import (
"bufio"
"os"
"fmt"
"flag"
"regexp"
"strings"
"log"
@moorage
moorage / Gemfile4.0.rb
Last active December 19, 2015 14:19
Raw Gemfile from running 'rails new NEWAPP' with Rails 4.0 + Ruby 2.0
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
@moorage
moorage / scaffolded_users_controller_rails4.rb
Created July 10, 2013 17:37
Controller output of rails g scaffold user name:string admin:boolean
class UsersController < ApplicationController
before_action :set_user, only: [:show, :edit, :update, :destroy]
# GET /users
# GET /users.json
def index
@users = User.all
end
# GET /users/1
@moorage
moorage / Gemfile4.0Upgrade.rb
Created July 10, 2013 17:27
Cinchro Gemfile after 4.0 Upgrade
source 'https://rubygems.org'
ruby '2.0.0'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
import "code.google.com/p/go.net/html"
func innerHtml(n *html.Node) string {
if (n == nil) {
return ""
}
result := ""
if n.Type == html.TextNode {
result = result + strings.TrimSpace(n.Data)
@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>