Skip to content

Instantly share code, notes, and snippets.

Avatar
:atom:

Francesco 'makevoid' Canessa makevoid

:atom:
View GitHub Profile
@makevoid
makevoid / install_bitcoin.sh
Last active Aug 13, 2022
Install bitcoin - bitcoind - v 0.19.0.1 - from binary - bitcoin.org - quick install
View install_bitcoin.sh
set -xe
mkdir ~/tmp
cd ~/tmp
wget https://bitcoin.org/bin/bitcoin-core-0.19.0.1/bitcoin-0.19.0.1-x86_64-linux-gnu.tar.gz --no-check-certificate
# check the shasum
tar xvf bitcoin-0.19.0.1-x86_64-linux-gnu.tar.gz
@makevoid
makevoid / hosted_example.txt
Created Aug 27, 2011
JQuery DOM HighLighter (it's a basic "Inspect element" simple implementation to mimic what webkit inspector and firebug do)
View hosted_example.txt
http://uploads.makevoid.com/jquery_dom_highlighter.html
@makevoid
makevoid / install-ruby-3-debian.sh
Last active Dec 25, 2021
Install Ruby 3 from soure on Debian (10)
View install-ruby-3-debian.sh
# onliner usage:
# bash <(curl -s https://gist.githubusercontent.com/makevoid/2be2170f17801c761aadfe7d9978b003/raw/0fd04b699b5ef461205f0e0ca831bc60b3b72a98/install-ruby-3-debian.sh)
set -xe
apt update -y
apt install -y build-essential git redis-server cmake vim wget curl libsqlite3-dev python apt-transport-https ca-certificates automake libtool libzlcore-dev libyaml-dev openssl libssl-dev zlib1g-dev libreadline-dev libcurl4-openssl-dev software-properties-common libreadline6-dev
mkdir -p ~/tmp
View Multipart file upload ruby.rb
# from: http://kfahlgren.com/blog/2006/11/01/multipart-post-in-ruby-2/
# edited by makevoid, http://makevoid.com
URL = "http://localhost:3000/your_url"
TIMEOUT_SECONDS = 10
params = {}
file = File.open(filename, "rb")
params["file[replay]"] = file
View gchart_offline.html
<!--
How to use Google JS Visualization Api offline, step by step
this approach might work with other libraries loaded with google.load, after all it's still JavaScript!!!
-->
<!DOCTYPE html>
<html>
@makevoid
makevoid / example-erc721.sol
Last active Sep 23, 2021
Sample ERC721 from Openzeppelin - flattened with remix - generated by https://wizard.openzeppelin.com/#erc721 - options: mintable, auto increment ids, uri storage - ownership: ownable
View example-erc721.sol
// 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 Apr 13, 2021
Kubernetes Deployer Config Stack Definition File - stacks.yml
View 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 Jan 23, 2012
Resize Images with Canvas on the clientside
View img_resize.js
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 Jul 14, 2020
Install Redis latest Debian 9
View install-redis.sh
# 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 Jul 10, 2020
install-node-nodesource.sh
View install-node.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 )