Skip to content

Instantly share code, notes, and snippets.

View Lyoness's full-sized avatar

Carmen Andoh Lyoness

View GitHub Profile
import (
"encoding/json"
)
#Predicate: {
Data: string
Timestamp: string
}
#ExternalRefs: {
// StackOverflow analysis using its API in Go.
//
// Eli Bendersky [https://eli.thegreenplace.net]
// This code is in the public domain.
package main
import (
"encoding/json"
"flag"
"fmt"
@tkshill
tkshill / blog.md
Last active September 10, 2024 07:55
A Starter Guide To Open Source Maintenance

Introduction

This document serves as a way for this project's maintainers to document their process of getting their repository ready for the 2020 Hacktoberfest alongside the Virtual Coffee Hacktoberfest Initiative. We also hope this project continues beyond just Hacktoberfest, and so we thought it best to collect all the knowledge, resources and learnings we pick up along the way in one central place, both for our own reflection, as well as sometimes that others can use to create welcoming and valuable spaces for their own open source contributions.

While we will try as best as possible to create a body of knowledge that is accessible and understandable to everyone who finds it, we hope you understand that this may not always be as comprehensive, current or exact as you may want to be. The language will be more candid that you might find in your typical technical documentation, and YMMV _(Your

@kevin-cantwell
kevin-cantwell / dancing_gopher_playground.go
Created May 17, 2019 00:35
Prints a dancing gopher to the output in the Go playground
package main
import (
"bytes"
"context"
"fmt"
"image"
"image/gif"
"io"
"os"

Inclusion Rider

I'm lucky enough to get asked to speak at a number of conferences, and I want to make sure I use that privilege to help improve the state of the industry. As a result I've put together a list to make sure the conferences I speak at reflect my values:

For all events

  • Code of Conduct: There must be a code of conduct that is clearly visible on the front page of the website, and which covers all conference participants including sponsors. The code of conduct must include details on who to contact and guidelines on enforcement and reporting. A good sample code of conduct is available at http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Policy
  • Speaker diversity: At least 40% of speakers (including keynote speakers) must be women or nonbinary folks, and if the conference is held in North America, Europe, or Australia/NZ, at least 5% must be of non-European origin. If you would like me to speak on a panel, there must be at least two women on the panel.
  • Bathrooms: There m
@vbatts
vbatts / main.go
Last active October 24, 2017 23:55
[golang] Looking for struct pointers in interface function signatures
package main
// spurred from discussion around https://github.com/kubernetes/kubernetes/pull/54257#issuecomment-338274869
import (
"flag"
"fmt"
"go/ast"
"go/build"
"go/parser"
@evancz
evancz / data-interchange.md
Last active October 31, 2024 12:01
Why do I have to write JSON decoders in Elm?

A vision for data interchange in Elm

How do you send information between clients and servers? What format should that information be in? What happens when the server changes the format, but the client has not been updated yet? What happens when the server changes the format, but the database cannot be updated?

These are difficult questions. It is not just about picking a format, but rather picking a format that can evolve as your application evolves.

Literature Review

By now there are many approaches to communicating between client and server. These approaches tend to be known within specific companies and language communities, but the techniques do not cross borders. I will outline JSON, ProtoBuf, and GraphQL here so we can learn from them all.

@posener
posener / go-shebang-story.md
Last active October 18, 2024 01:42
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.

#!/usr/bin/env bash
set -o errexit
: ${GIT:=git}
__mainremote() {
if [[ "${REMOTE}" ]] ; then
echo "${REMOTE}"
return
fi
aight so this is actually really fun but simple.
so remember yr binary math (or skip this if yr confident w/ binary):
1 2 4 8 16
----------
1 0 0 0 0 = 1 in decimal
0 0 1 0 0 = 4 in decimal
1 1 1 1 1 = 31 in decimal, etc