Skip to content

Instantly share code, notes, and snippets.

@steeve
steeve / _readme.md
Last active July 9, 2024 04:49
How to cross compile Go with CGO programs for a different OS/Arch

How to cross compile Go with CGO programs for a different OS/Arch

It is possible to compile Go programs for a different OS, even though go build says otherwise.

You'll need:

@pabigot
pabigot / main.c
Created January 1, 2015 21:22
DS18B20 one-wire demo on nRF51
/* BSPACM - nRF51 DS18B20 OneWire interface
*
* Copyright 2012-2015, Peter A. Bigot
*
* All rights reserved.
*
* 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,
@am-MongoDB
am-MongoDB / MongoDBSimpleConsumer.java
Created May 16, 2016 15:43
Example MongoDB consumer for Apache Kafka
package com.clusterdb.kafka;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import kafka.api.FetchRequest;
import kafka.api.FetchRequestBuilder;
import kafka.api.PartitionOffsetRequestInfo;
import kafka.common.ErrorMapping;
import kafka.common.TopicAndPartition;
import kafka.javaapi.*;
@johndstein
johndstein / mssql-stream-insert.js
Last active June 15, 2021 20:16
Node.js writable stream that connects to db, drops and creates table, and then bulk loads rows into table
#!/usr/bin/env node
'use strict';
// Stream unlimited rows into a Sql Server table.
// WARNING!!! WE DROP and RE-CREATE the table. Then stream the data into it.
// Source stream must be an object stream. Object property names must match
// table column names. Since SQL Server isn't case sensitive, don't think case
@ipmb
ipmb / transfer.tf
Created December 18, 2020 23:10
AWS Transfer Server with Elastic IP in terraform
variable "TRANSFER_HOST_KEY" {}
locals {
transfer = {
az_count = 2
}
}
resource "aws_eip" "transfer" {
count = local.transfer.az_count