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()
}
@endocrimes
endocrimes / Screencapture timelapse bash
Created November 23, 2013 00:25
Screencapture timelapse bash
i=1;while [ 1 ];do screencapture -t jpg -x ~/Desktop/screencapture/$i.jpg; let i++;sleep 5; done
#include <stdio.h>
enum RightsFlags {
user = 2,
moderator = 4,
admin = 8
};
int hasFlag(int haystack, int needle) {
return (haystack & needle) == needle;
License Agreement for Source Code provided by Daniel Tomlinson
This software is supplied to you by Daniel Tomlinson in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this software.
In consideration of your agreement to abide by the following terms, and subject to these terms, Daniel Tomlinson grants you a personal, non-exclusive license, to use, reproduce, modify and redistribute the software, with or without modifications, in source and/or binary forms; provided that if you redistribute the software in its entirety and without modifications, you must retain this notice and the following text and disclaimers in all such redistributions of the software, and that in all cases attribution of Daniel Tomlinson as the original author of the source code shall be included in all such resulting software pro