Skip to content

Instantly share code, notes, and snippets.

struct WorldGrid {
static const size_t vertexDataStride = 6;
wgpu::Buffer _indexBuffer;
wgpu::BindGroup _bindGroup;
wgpu::DepthStencilState _depthStencil;
wgpu::RenderPipeline _pipeline;
WorldGrid() {
_depthStencil.format = wgpu::TextureFormat::Depth24PlusStencil8;
// Note that this is not the production code
pragma solidity 0.5.6;
import "./IERC20.sol";
contract Wallet {
address internal token = 0x123...<hot_wallet_addr>;
address internal hotWallet = 0x321...<hot_wallet_addr>;
constructor() public {
@njh
njh / jackd.service
Last active October 6, 2022 03:55
systemd service file for running headless JACK server
[Unit]
Description=JACK
After=sound.target
[Service]
LimitRTPRIO=infinity
LimitMEMLOCK=infinity
User=rotter
ExecStart=/usr/bin/jackd --realtime -P89 -d alsa -d hw:1 -r 48000
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
@mdPlusPlus
mdPlusPlus / compile_newest_stable_kernel_with_acso_patch.sh
Last active March 22, 2023 12:19
Download, patch, compile and install the newest stable Linux kernel with the ACS override patch (Ubuntu / Debian)
#!/bin/bash
function install_dependencies() {
echo "Installing dependencies..."
sudo apt -qq update
sudo apt -qq install -y curl git wget
# sudo apt -qq install -y bison flex kernel-package libelf-dev libssl-dev
sudo apt -qq install -y bison flex libelf-dev libssl-dev
}
#!/bin/sh
# install needed curl package
sudo apt install --no-install-recommends curl -y
# install kubectl
# https://github.com/kubernetes/minikube/issues/3437#issuecomment-449408316, maybe use https://storage.googleapis.com/minikube/releases/v0.30.0/docker-machine-driver-kvm2
curl -Lo /tmp/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \
chmod +x /tmp/kubectl && \
sudo mv /tmp/kubectl /usr/local/bin/kubectl
# kubectl tab completion
sudo sh -c 'echo "source <(kubectl completion bash)" > /etc/bash_completion.d/kubectl'
@jsmouret
jsmouret / struct.go
Last active November 1, 2022 10:06
Convert map[string]interface{} to a google.protobuf.Struct
package pb
import (
"fmt"
"reflect"
st "github.com/golang/protobuf/ptypes/struct"
)
// ToStruct converts a map[string]interface{} to a ptypes.Struct
@hiasinho
hiasinho / instructions.md
Last active January 26, 2017 13:48
DigitalOcean, Dokku, Rails, PostgreSQL
@tombsar
tombsar / OpenSimplexNoise.hh
Last active March 4, 2022 22:35 — forked from KdotJPG/OpenSimplex2S.java
C++ port of KdotJPG's OpenSimplexNoise in Java. A self-contained set of functions for generating visually axis-decorrelated, coherent noise from a simplectic honeycomb.
/*
* OpenSimplex (Simplectic) Noise in C++
* by Arthur Tombs
*
* Modified 2015-01-08
*
* This is a derivative work based on OpenSimplex by Kurt Spencer:
* https://gist.github.com/KdotJPG/b1270127455a94ac5d19
*
* Anyone is free to make use of this software in whatever way they want.
@castano
castano / hemicube.cpp
Created June 20, 2014 09:46
Hemicube Integrator
#include "hemicube.h"
#define PACK_HEMICUBES 1
static void get_hemicube_face_normal(int index, Vector3 *forward, Vector3 *left, Vector3 *up) {
// Unwrapped hemicube with positive-Z in the middle.
switch (index) {
case 0: *forward = Vector3(+1, 0, 0); *left = Vector3( 0, 1, 0); break;