Skip to content

Instantly share code, notes, and snippets.

🐢
🦄 🦄 🦄 🦄 🦄 🦄 🦄 🦄

Michael Schuett michaeljs1990

🐢
🦄 🦄 🦄 🦄 🦄 🦄 🦄 🦄
Block or report user

Report or block michaeljs1990

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@robbwagoner
robbwagoner / awscli-pex.md
Last active Oct 16, 2018
AWS CLI with PEX
View awscli-pex.md

What is PEX?

build with Docker image... e.g. Ubuntu 14.04

$ docker run --rm -it -v $PWD:/src -w /src ubuntu:14.04

Install PEX

@y0ssar1an
y0ssar1an / .travis.yml
Last active Oct 18, 2019
Example .travis.yml for Golang
View .travis.yml
# use the latest ubuntu environment (18.04) available on travis
dist: xenial
language: go
# Force-enable Go modules. Also force go to use the code in vendor/
# These will both be unnecessary when Go 1.13 lands.
env:
- GO111MODULE=on
- GOFLAGS='-mod vendor'
View README.md
View CGO.md

Problems & Solutions for Interaction Between C and Go

At Vimeo, on the transcoding team, we work a lot with Go, and a lot with C, for various tasks such as media ingest. This means we use CGO quite extensively, and consequently, have run into bits that are perhaps not very well documented, if at all. Below is my effort to document some of the problems we've run into, and how we fixed or worked around them.

Many of these are obviously wrong in retrospect, but hindsight is 20/20, and these problems do exist in many codebases currently.

Some are definitely ugly, and I much welcome better solutions! Tweet me at @daemon404 if you have any, or have your own CGO story/tips, please! I'd love to learn of them.

Table of Contents

@barosl
barosl / add.c
Created Jul 26, 2015
Function overloading in C
View add.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int addi(int a, int b) {
return a + b;
}
char *adds(char *a, char *b) {
char *res = malloc(strlen(a) + strlen(b) + 1);
@rendoaw
rendoaw / linux_lldp.md
Last active Dec 12, 2016
Linux Enable LLDP
View linux_lldp.md
View what-the-commit.md

#What is a commit?

In the simplest literal terms possible, a commit represents a change to lines of code in a revision control system, along with a description. The mechanics of most VCSes don't prescribe anything beyond that simple model. It's a concept that has been in use (and misuse) for a little over 40 years, and a central concept in every major version control system ever released. Given that, and the fact that you're reading this document, and the fact that this document is in a revision control system, you're probably already familiar with this concept.

You are probably also familiar with people making "bad commits", but what you might not be familiar with is a team that makes only "good commits", and more particularly the organizational implications of doing so. This document aims to explore those implications.

In order to get a good conceptual framework for ho

@rygorous
rygorous / vr_urgh.txt
Last active Oct 6, 2018
What I mean when I say "I think VR is bad news".
View vr_urgh.txt
This just got linked to by the Y combinator news account, without proper context,
so a brief introduction: A month ago (end of May / early June 2014) I had a
Twitter conversation with a bunch of acquaintances. One tweet in the middle
of that thread, with obligatory hyperbole, was me saying that I think VR is
bad news.
Well, that part of the thread (but not the rest that provides context) recently
got retweeted, and then someone asked me if I could explain what I mean by that,
and because Twitter is a great platform for delivering 140 character slogans and
not so great for lengthy explanations, I wrote this. So, obligatory disclaimer:
View set_irq_affinity.sh
#!/bin/bash
#
# Copyright (c) 2014, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
@davidandrzej
davidandrzej / TrickyMapValues.scala
Last active Jun 7, 2017
Scala Map.mapValues returns a (lazy) view. Hilarity ensues.
View TrickyMapValues.scala
//
// TIL Scala Map.mapValues returns a lazy view
//
// This has the horrific consequence that supplying a non-pure function
// can yield a result map with unexpected / undesired behavior (see below)
//
// Further discussion here:
// http://stackoverflow.com/questions/14882642/scala-why-mapvalues-produces-a-view-and-is-there-any-stable-alternatives
// https://issues.scala-lang.org/browse/SI-4776
//
You can’t perform that action at this time.