Skip to content

Instantly share code, notes, and snippets.

View makevoid's full-sized avatar
:atom:
coding

Francesco 'makevoid' Canessa makevoid

:atom:
coding
View GitHub Profile
@makevoid
makevoid / example-erc721.sol
Last active September 23, 2021 04:59
Sample ERC721 from Openzeppelin - flattened with remix - generated by https://wizard.openzeppelin.com/#erc721 - options: mintable, auto increment ids, uri storage - ownership: ownable
// File: @openzeppelin/contracts@4.3.2/utils/Counters.sol
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
@makevoid
makevoid / stacks.yml
Created April 13, 2021 08:58
Kubernetes Deployer Config Stack Definition File - stacks.yml
launchpad: # project name
project: launchpad # project name (again)
github_repo: launchpad-kube # github.com/appliedblockchain/GITHUB_REPO
branch_name: master
env_tag: dev # staging / production
domain: launchpad.appb.ch # url to reach the ingress / load balancer
containers: # list of containers that need to be built by the build server
- name: launchpad-api
dir: api
- name: launchpad-react
@makevoid
makevoid / img_resize.js
Created January 23, 2012 00:29
Resize Images with Canvas on the clientside
var settings = {
max_width: 600,
max_height: 200
}
resize_image = function(img){
var ctx = canvas.getContext("2d")
var canvasCopy = document.createElement("canvas")
var copyContext = canvasCopy.getContext("2d")
@makevoid
makevoid / install-redis.sh
Last active July 14, 2020 23:05
Install Redis latest Debian 9
# bash <(curl -s https://gist.githubusercontent.com/makevoid/bb4aad8ee7600c21eff24ceeedfa9436/raw/e929cb69524cb12c2a217e3d0b97ac08f390d046/install-redis.sh )
set -xe
# debian
mkdir -p ~/tmp
cd ~/tmp
wget http://ppa.launchpad.net/chris-lea/redis-server/ubuntu/pool/main/r/redis/redis-tools_6.0.5-1chl1~bionic1_amd64.deb
wget http://ppa.launchpad.net/chris-lea/redis-server/ubuntu/pool/main/r/redis/redis-server_6.0.5-1chl1~bionic1_amd64.deb
@makevoid
makevoid / install-node.sh
Created July 10, 2020 23:39
install-node-nodesource.sh
# Using Ubuntu
# curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
# sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_14.x | bash -
apt-get install -y nodejs
# debian oneliner:
# bash <(curl -s https://gist.githubusercontent.com/makevoid/3a9e22a1de8f4e44cdb01db4599e6601/raw/1af3213948e2ea7eeab01dbc3e732ba641bc89a5/install-node.sh )
@makevoid
makevoid / btcpayserver-install.sh
Last active July 1, 2020 06:29
Lightsail 2 VCPUs 20$/mo 80GB instance btcpayserver
# bash <(curl -s https://gist.githubusercontent.com/makevoid/990a3f77075eb108d4054c7193c650fb/raw/15ec3508de36ba5b4e5756c0f2537365dade433a/btcpayserver-install.sh )
set -xe
mkdir BTCPayServer
cd BTCPayServer
git clone https://github.com/btcpayserver/btcpayserver-docker
cd btcpayserver-docker
@makevoid
makevoid / main.rb
Created June 12, 2020 08:02
DragonRuby platformer attempt - first mockup of the game
class World
# PADDING = 10
end
class Player
GUN_HEIGHT = 45
end
class Projectile
SPEED = 4
@makevoid
makevoid / main.rb
Last active June 11, 2020 12:25
DragonRuby game starter - Tile board (square tiles) - simple base for a boardgame
class Color
RED = [200, 128, 128]
BLUE = [128, 128, 200]
GREEN = [128, 200, 128]
WHITE = [200, 200, 200]
GREY = [128, 128, 128]
BLACK = [20, 20, 20 ]
end
class World
@makevoid
makevoid / stringify_recursive.rb
Last active May 22, 2020 04:19 — forked from edvardm/symbolize_recursive.rb
Recursively symbolize ruby hash keys in a nested structure. Uses refinements instead of monkey patching Hash.
# # usage:
# require_relative 'lib/stringify_helper'
# extend StringifyHelper
# using StringifyHelper
#
# { test: { foo: "bar" } }.deep_stringify_keys #=> \
# # { "test" => { "foo" => "bar" } }
module StringifyHelper
extend self
@makevoid
makevoid / install-parity.sh
Last active April 23, 2020 13:06
Install latest parity debian
set -xe
apt-get update -y
mkdir -p ~/parity
cd ~/parity
wget https://releases.parity.io/ethereum/v2.7.2/x86_64-unknown-linux-gnu/parity