Code Monkey home page Code Monkey logo

go's Introduction

Go packages and commands

This repository contains a collection of useful go packages and cmds that I've built over the past few years.

Commands

  • deptrace: a simple command line tool to find how a particular package is imported by another. For example, the following will find the series of imports that lead grail-tidy to depend on testing. I've found it be much more useful than the various graphical tools for visualizing dependencies that don't seem to work that well. It's written to be parallized but I haven't needed to do so yet.

    deptrace --path grail.com/cmd/grail-tidy --src = $HOME/go/src/grail.com testing

pulsemon - pulse counting for a water meter

  • pulsemon implements a simple water meter monitor using the piface board and a water meter with a reed switch built in. It supports alerting, logging of timestamps and is easily dockerized. It's also a decent example of how simple it is to use go concurrency for monitoring applications and avoids the complexity of interrupts and callbacks (which is handy since interrupts are not currently implemented for the piface board!).

Packages

  • cmap: a simple concurrent mapper.
	sleeper := func(v interface{}) interface{} {
		n := v.(int)
		time.Sleep(time.Millisecond * 200)
		return -n
	}
	input := make(cmap.Vector, 1000)
	for i := range input {
		input[i] = i
	}
	then := time.Now()
	output := cmap.Map(input, sleeper, 100)
	taken := time.Now().Sub(then)
	if taken < 10*time.Second {
		fmt.Printf("nice and fast!\n")
	}
	fmt.Printf("len: %v\n", len(output))
	// Output: nice and fast!
	// len: 1000

go's People

Contributors

cosnicolaou avatar grailbio-bot avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.