Skip to content

Instantly share code, notes, and snippets.

View martin31821's full-sized avatar
:octocat:
Focusing

Martin Koppehel martin31821

:octocat:
Focusing
View GitHub Profile
@martin31821
martin31821 / cloudSettings
Last active August 5, 2019 14:54
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-05-22T11:54:27.552Z","extensionVersion":"v3.2.9"}
@martin31821
martin31821 / atn.sol
Created November 25, 2018 07:48
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=false&gist=
pragma solidity ^0.4.25;
contract SubmissionATN {
string submissionHash;
function get() public view returns (string hash) {
hash = submissionHash;
}
function set(string hash) public {
@martin31821
martin31821 / gist:176d00d4fadd900d0257dd4a38998657
Created July 26, 2018 12:29 — forked from devinodaniel/gist:8f9b8a4f31573f428f29ec0e884e6673
Generate SSH RSA Private/Public Key pair with Golang
// This shows an example of how to generate a SSH RSA Private/Public key pair and save it locally
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"golang.org/x/crypto/ssh"
@martin31821
martin31821 / update-hosts.sh
Created May 30, 2018 21:47 — forked from jamshid/update-hosts.sh
Docker environment hack, to put the names of running containers in /etc/hosts
#!/bin/bash
# An alternative to "links", run this script after starting or stopping any
# container. It's a hack to update the host machine (vagrant) /etc/hosts with
# the current active docker containers and tell dnsmasq to refresh.
#
# Then start each machine with "-dns ${DOCKER_HOST_IP}", e.g.
# $ docker run -d -name mycontainer1 -dns 10.0.3.1 MYPRODUCT
# You can't seem to set the DNS during "docker build".
#
# Diagnostic command to run in host or while logged into containers:
library IEEE;
use IEEE.std_logic_1164.all;
entity reg is
port (
clk : in std_logic;
i_port : in std_logic_vector(7 downto 0);
o_port : out std_logic_vector(7 downto 0)
);
end entity reg;
@martin31821
martin31821 / crc32.cs
Last active November 13, 2023 02:27
C# port of the crc32 algorithm
// inspired by http://opensource.apple.com//source/xnu/xnu-1456.1.26/bsd/libkern/crc32.c
// You may use this program, or
// code or tables extracted from it, as desired without restriction.
namespace CRC32
{
public static class CRC32
{
static readonly uint[] crc32_tab = {
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
@martin31821
martin31821 / fifo.h
Created September 11, 2016 20:06
C++ templated FiFo
#pragma once
#include <stdint.h>
/**
* Simple templated c++ FIFO implementation.
*
* Inspired by: https://www.mikrocontroller.net/articles/FIFO#FIFO_mit_C-Pr.C3.A4prozessor
*
* @typeparam TData The data type of the fifo.