Skip to content

Instantly share code, notes, and snippets.

View endocrimes's full-sized avatar

Danielle endocrimes

View GitHub Profile
package main
import (
"bytes"
_ "embed"
"fmt"
"os"
"os/exec"
"strings"
)

Keybase proof

I hereby claim:

  • I am endocrimes on github.
  • I am endocrimes (https://keybase.io/endocrimes) on keybase.
  • I have a public key ASC1zNIXUCnFfJcUJj7kwv-xZBdtlDUIpahL2YSDqRkHkgo

To claim this, I am signing this object:

if
allof(
address :is "From" "notifications@github.com",
address :is "Cc" "mention@noreply.github.com"
)
{
fileinto "INBOX.notifications.github.direct-mention";
}
elsif
allof(
@endocrimes
endocrimes / docker-static-go.md
Last active December 4, 2017 11:11
Steps for distributing small Docker images for Go binaries

Distributing smol Docker images for Go binaries

Building a fully static go binary:

$ GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o build/linux-{{tool-name}} .

The Dockerfile

@endocrimes
endocrimes / Makefile
Last active October 8, 2017 13:17
Golang Makefile Template
CIRCLE_BUILD_NUM ?= DEV
TAG = 0.0.$(CIRCLE_BUILD_NUM)-$(shell git rev-parse --short HEAD)
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOFILES = $(shell find . -name '*.go' -not -path './vendor/*')
@endocrimes
endocrimes / Observables.swift
Created July 14, 2014 23:00
A simple implementation of Observables in Swift
struct Observable<T> {
typealias Observer = (send:(newValue: T) -> ())
var observers = Dictionary<String, Observer>()
var value: T {
didSet {
_notify()
}

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

### Keybase proof
I hereby claim:
* I am DanielTomlinson on github.
* I am DanToml (https://keybase.io/DanToml) on keybase.
* I have a public key whose fingerprint is 45C5 0C27 226E 1713 C7BD 5189 A065 D094 7C49 2423
To claim this, I am signing this object:
@endocrimes
endocrimes / StyleGuide.md
Last active August 29, 2015 13:55
Objective-C style guide

My Objective-C Style guide

This style guide outlines the coding conventions that I try to stick to when writing Objective-C. I'm posting it here mostly as a brain dump and easy reference for the future, and to formalise it a little more.

It's pretty similar to that of the NYTimes. This document is mostly a customised version of that, you should go check theirs out!

Useful Resources

If you're looking to see some of the reasons behind some choices, or for something I haven't covered, look at the sites below, Apples documentation is pretty great.