Skip to content

Instantly share code, notes, and snippets.

View mattmc3's full-sized avatar
🐍
Python!

mattmc3 mattmc3

🐍
Python!
View GitHub Profile
@mattmc3
mattmc3 / hello.go
Created April 5, 2017 23:55
Golang Hello World
package main
import (
"fmt"
"log"
)
func check(err error) {
if err != nil {
log.Fatal(err)
@mattmc3
mattmc3 / sort_map.go
Last active April 5, 2017 23:57
Golang sort map keys
keys := make([]string, len(m))
i := 0
for k := range m {
keys[i] = k
i++
}
sort.Strings(keys)
@mattmc3
mattmc3 / unittest_template.go
Last active April 14, 2017 17:07
Go: unittest file template
package main
import (
"reflect"
"testing"
)
func TestMath(t *testing.T) {
var tests = []struct {
input []int
@mattmc3
mattmc3 / unittest_method.go
Last active April 14, 2017 17:07
Go: unittest method template
func Test{{THING}}(t *testing.T) {
var tests = []struct {
input string
expected string
}{
{``, ``},
}
for _, tt := range tests {
method := fmt.Sprintf(`{{THING}}(%#v)`, tt.input)
@mattmc3
mattmc3 / main.html
Created April 6, 2017 00:07
HTML template
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HTML5</title>
<link rel="stylesheet" href="css/styles.css?v=1.0">
</head>
<body>
<p>Hello</p>
@mattmc3
mattmc3 / theme.slack
Created April 6, 2017 00:16
Slack JuiceBar theme
http://slackthemes.net/#/juice_bar
#86A34E ,#94AF63 ,#FFFFFF ,#6D8B42 ,#94AF63 ,#FFFFFF ,#FFB10A ,#DFA044
@mattmc3
mattmc3 / plaintasks.txt
Created April 6, 2017 00:34
Sublime Text PlainTasks Template
# Sublime PlainTasks https://github.com/aziz/PlainTasks
# ⌘-i : Add new task
# ⌘-[enter] : Add new task (alt)
# ⌘-d : Mark task done
# ⌘-[shift]-a : Archive completed tasks
# ⌘-[shift]-u : Open URL
# ⌘-r : Show projects
# [ctrl]-c : Cancel task
# [tab] : Insert date when between parens
#
@mattmc3
mattmc3 / .editorconfig
Created April 6, 2017 00:35
EditorConfig template
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
@mattmc3
mattmc3 / pg_dump_schema.sh
Created April 6, 2017 00:38
Postgres dump schema
# Dump a schema to a .sql file
pg_dump -U postgres -s {{db}} > {{db}}.sql
@mattmc3
mattmc3 / django_secret_key.py
Created April 6, 2017 00:40
Django make new secret key
from django.utils.crypto import get_random_string
chars = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
get_random_string(50, chars)