Skip to content

Instantly share code, notes, and snippets.

View adamryman's full-sized avatar

Adam Ryman adamryman

View GitHub Profile

Wire through vs global import

Preface

All of this came to mind reading through python code which passed a logger through the application. I mentally contrasted this pattern with a golang logger I created. This golang logger had an exported package level variable which was initialized as a logger without any functions being called. Said logger could be accessed directly from an import anywhere in the application.

As a result of this consideration, I wrote this document to get out my thoughts loggers wired through vs globally accessible via import.

Purpose

// Code generated by protoc-gen-go. DO NOT EDIT.
// source: shared.proto
package shared
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
$ echo -e "yoyo my G-lib,\nI know u think your pretty tough.\nU aint got MUSL" | gophersay
------------------------
yoyo my G-lib,
I know u think your pretty tough.
U aint got MUSL
------------------------
\
\
\ ,_---~~~~~----._
_,,_,*^____ _____``*g*\"*,
$ echo -e "yoyo my G-lib,\nI know u think your pretty tough.\nBut you aint got MUSL" | gophersay
------------------------
yoyo my G-lib,
I know u think your pretty tough.
But you aint got MUSL
------------------------
\
\
\ ,_---~~~~~----._
_,,_,*^____ _____``*g*\"*,

gitlab-ci-dispatcher

Launch the gitlab runner, through a cli command.

Todo: Build a job dispatcher service that reads in a .gitlab-ci.yml definition file and creates a queue of jobs

  • parse the stages
  • parse the dependencies and artifacts
  • parse "when"
  • have queues of jobs that can run in parallel

lgtm; slackbot for #pr-party Build Status

lgtm lets uses add github integrations to the slack channel #pr-party for posting to the channel when a new pull request opens.

TODO

@adamryman
adamryman / helloworlddoer.go
Created January 31, 2017 00:14
Program for testing programs that launch other programs. Dawg.
package main
import (
"fmt"
"time"
"github.com/pkg/errors"
flag "github.com/spf13/pflag"
)
@adamryman
adamryman / viz.go
Created January 13, 2017 18:00
vizvizviz
package viz
import (
"log"
"math"
"os"
"github.com/mjibson/go-dsp/fft"
"github.com/mjibson/go-dsp/wav"
)
@adamryman
adamryman / wave_main.go
Created January 7, 2017 06:37
Play wav files with go, slowed down it seems for now. Will work more later
package main
import (
"encoding/binary"
"fmt"
"math"
"os"
"github.com/mesilliac/pulse-simple"
"github.com/mjibson/go-dsp/wav"
@adamryman
adamryman / gobuild-count-time.sh
Created December 24, 2016 03:22
Build a go project and count how many seconds have passed then print `time` that it took.
a=1; done=0; while [[ ! -e "./__done__" ]]; do sleep 1; echo $a; a=$(($a+1)); done & time go build ./... && touch __done__ && sleep .99 && rm __done__