Skip to content

Instantly share code, notes, and snippets.

🐍
Python!

mattmc3 mattmc3

🐍
Python!
Block or report user

Report or block mattmc3

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mattmc3
mattmc3 / hello.go
Created Apr 5, 2017
Golang Hello World
View hello.go
package main
import (
"fmt"
"log"
)
func check(err error) {
if err != nil {
log.Fatal(err)
@mattmc3
mattmc3 / sort_map.go
Last active Apr 5, 2017
Golang sort map keys
View sort_map.go
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 Apr 14, 2017
Go: unittest file template
View unittest_template.go
package main
import (
"reflect"
"testing"
)
func TestMath(t *testing.T) {
var tests = []struct {
input []int
@mattmc3
mattmc3 / unittest_method.go
Last active Apr 14, 2017
Go: unittest method template
View unittest_method.go
func Test{{THING}}(t *testing.T) {
var tests = []struct {
input string
expected string
}{
{``, ``},
}
for _, tt := range tests {
method := fmt.Sprintf(`{{THING}}(%#v)`, tt.input)
View main.html
<!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 Apr 6, 2017
Slack JuiceBar theme
View theme.slack
http://slackthemes.net/#/juice_bar
#86A34E ,#94AF63 ,#FFFFFF ,#6D8B42 ,#94AF63 ,#FFFFFF ,#FFB10A ,#DFA044
@mattmc3
mattmc3 / plaintasks.txt
Created Apr 6, 2017
Sublime Text PlainTasks Template
View plaintasks.txt
# 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 Apr 6, 2017
EditorConfig template
View .editorconfig
# 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 Apr 6, 2017
Postgres dump schema
View pg_dump_schema.sh
# Dump a schema to a .sql file
pg_dump -U postgres -s {{db}} > {{db}}.sql
@mattmc3
mattmc3 / django_secret_key.py
Created Apr 6, 2017
Django make new secret key
View django_secret_key.py
from django.utils.crypto import get_random_string
chars = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
get_random_string(50, chars)
You can’t perform that action at this time.