Skip to content

Instantly share code, notes, and snippets.

@novabyte
novabyte / Dockerfile
Last active April 29, 2022 14:01
A small Docker-based build setup to create and build Go code with Nakama server.
FROM heroiclabs/nakama-pluginbuilder:3.2.0 AS builder
ENV GO111MODULE on
ENV CGO_ENABLED 1
WORKDIR /backend
COPY . .
RUN go build --trimpath --mod=vendor --buildmode=plugin -o ./backend.so
@extrawurst
extrawurst / RunTestsBeforeBuild.cs
Created October 30, 2019 09:43
Unity TestRunnerApi to run UnitTests before each build
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;
using UnityEditor.TestTools.TestRunner.Api;
public class ResultCollector : ICallbacks
{
public ITestResultAdaptor Result { get; private set; }
public void RunFinished(ITestResultAdaptor result)
@HarryR
HarryR / MiMCp.sol
Last active August 15, 2024 06:37
MiMC-p/p for Solidity
// Copyright (c) 2018 HarryR
// License: LGPL-3.0+
pragma solidity ^0.5.0;
/**
* Implements MiMC-p/p over the altBN scalar field used by zkSNARKs
*
* See: https://eprint.iacr.org/2016/492.pdf
*
@cc32d9
cc32d9 / nodeos_full_node_setup.txt
Last active August 2, 2023 13:21
nodeos installation with ZFS
apt-get update && apt-get install -y aptitude git lxc-utils zfsutils-linux netfilter-persistent sysstat
# find the partition ID that is linked to the storage serial number.
# This will prevent from losing the partition if disk mapping changes
ls -l /dev/disk/by-id/ | grep sda6
zpool create -f zdata /dev/disk/by-id/wwn-0x600507604092b628236df4851535cef5-part6
## Fixate internal IP address of the container
systemctl stop lxc-net
sed -i -e 's,^.*LXC_DHCP_CONFILE,LXC_DHCP_CONFILE,' /etc/default/lxc-net
@Adron
Adron / install-golang-apt-get.sh
Last active July 17, 2024 18:55
Installing golang via apt-get
sudo add-apt-repository ppa:ubuntu-lxc/lxd-stable
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install golang
# Usually this is good to install golang, but alas the apt-get repo is usually out of sync with the latest.
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active September 17, 2024 08:31
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@mdang
mdang / RAILS_CHEATSHEET.md
Last active September 19, 2024 17:20
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@seanbuscay
seanbuscay / git_create_orphan.sh
Created June 27, 2013 15:26
Create an orphan branch in a repo.
cd repository
git checkout --orphan orphan_name
git rm -rf .
rm '.gitignore'
echo "#Title of Readme" > README.md
git add README.md
git commit -a -m "Initial Commit"
git push origin orphan_name
@emil2k
emil2k / Connectivity.java
Last active August 5, 2024 10:48
Android utility class for checking device's network connectivity and speed.
/*
* Copyright (c) 2017 Emil Davtyan
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@ericbmerritt
ericbmerritt / gist:4013729
Created November 4, 2012 20:53
A script to generate a valid semver version in any git repo
#!/bin/bash
#
# If run inside a git repository will return a valid semver based on
# the semver formatted tags. For example if the current HEAD is tagged
# at 0.0.1, then the version echoed will simply be 0.0.1. However, if
# the tag is say, 3 patches behind, the tag will be in the form
# `0.0.1+build.3.0ace960`. This is basically, the current tag a
# monotonically increasing commit (the number of commits since the
# tag, and then a git short ref to identify the commit.
#