Skip to content

Instantly share code, notes, and snippets.

View andrew-waters's full-sized avatar

Andrew Waters andrew-waters

View GitHub Profile
@posener
posener / go-shebang-story.md
Last active March 29, 2024 08:38
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@PurpleBooth
PurpleBooth / README-Template.md
Last active May 3, 2024 18:53
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@aaronlerch
aaronlerch / README.md
Created August 7, 2013 16:46
Upstart scripts for MongoDB Monitoring Service agent (MMS) MongoDB Backup Service agent (MBS?)

Download

Download and install the agent(s). These examples are on a standard 64-bit Amazon EC2 Linux AMI.

MMS

wget [path to mms agent download, specified by 10gen]
sudo tar xvzf 10gen-mms-agent-[CUSTOM_NAME].tar.gz -C /opt
@mattetti
mattetti / multipart_upload.go
Last active April 22, 2024 05:24
Example of doing a multipart upload in Go (golang)
package main
import (
"bytes"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"os"
@gorhill
gorhill / render_number.go
Last active April 21, 2024 05:50
A Go function to render a number to a string based on the following user-specified criteria: thousands separator, decimal separator, decimal precision. I didn't feel it was worth to publish a library just for this piece of code, hence the snippet. Feel free to reuse as you wish.
/*
Author: https://github.com/gorhill
Source: https://gist.github.com/gorhill/5285193
A Go function to render a number to a string based on
the following user-specified criteria:
* thousands separator
* decimal separator
@ksafranski
ksafranski / Common-Currency.json
Last active April 22, 2024 15:16
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},