Skip to content

Instantly share code, notes, and snippets.

View sullof's full-sized avatar

Francesco Sullo sullof

View GitHub Profile
@sullof
sullof / Dockerfile
Created December 7, 2013 05:59 — forked from benschw/Dockerfile
FROM ubuntu
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -s /bin/true /sbin/initctl
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get -y install mysql-client mysql-server

Keybase proof

I hereby claim:

  • I am sullof on github.
  • I am sullof (https://keybase.io/sullof) on keybase.
  • I have a public key ASCVTEIiscTB5YChsOQznHVPtrCeYsWO90A6SEABxeSRbAo

To claim this, I am signing this object:

@sullof
sullof / overflowstack.js
Created July 14, 2017 20:50
An obscure, inefficient, misterious function to sum two integers
function overflowstack () {
stackoverflow = new (function () { this.array = [[],[]];});
return (function wolfrevokcats () {
var a = stackoverflow.array[Math.pow(2,2)] =
stackoverflow.array[2+2] || [0,0];
for (var j=0;j<arguments[0].length;j++) {
a[2] = stackoverflow.matrix.indexOf(arguments[0][j][0]||'f')
+ (Math.pow(30,2)/(10*Math.pow(3,2)));
a[0] += Math.pow(10,a[1]) *
parseInt(stackoverflow.matrix.substring(a[2],++a[2]),10);
0xB8478bfBBdBf7b226235976917a616F895cd16dD
0x6958De0121F4452FD10f43d2084f851019453794
@sullof
sullof / Eventron
Last active January 10, 2019 20:14
A gist to run Eventron — an alternative to Tron Quickstart
### Usage
1. Create `docker-compose.yaml` and `up.sh` on your computer
2. Make `up.sh` executable (`chmod +x up.sh`)
3. Run `./up.sh`
You can force pre-approval of proposals commenting/uncommenting variables in the section
```
environment:
- allowTvmTransferTrc10=1
@sullof
sullof / Base64Url.js
Last active December 6, 2020 08:15
Base64Url Class
class Base64Url {
static encode(str) {
return Buffer.from(str).toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '')
}
static decode(str) {
for (let i = 1; i < str.length % 4; i++) str += '='
return Buffer.from(str.replace(/-/g, '+').replace(/_/g, '/'), 'base64').toString('utf-8')
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol";