Skip to content

Instantly share code, notes, and snippets.

View menxit's full-sized avatar

Federico Ginosa menxit

View GitHub Profile
[
{
"constant": true,
"inputs": [
{
"name": "_owner",
"type": "address"
}
],
"name": "balanceOf",
[{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [{
"indexed": true,
"internalType": "address",
[{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"mint","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name"
[
{
"constant": true,
"inputs": [],
"name": "name",
"outputs": [
{
"name": "",
"type": "string"
}
const test = (name, foo, measures = [10, 100, 1000, 10000, 100000, 1000000]) => {
console.log(name);
measures.forEach(async n => {
const start = new Date();
await Promise.all(new Array(n).fill(1).map(() => foo));
const end = new Date();
const time = end.getTime() - start.getTime();
console.log(`${n} requests`);
console.log(` Total time: ${time/1000} s`);
console.log(` Average time: ${time/n} ms`);
;; ido-mode
(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
(ido-mode 1)
;; helm configuration
(use-package helm
:ensure t
:bind
("M-x" . helm-M-x)
;; ido-mode
(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
(ido-mode 1)
;; helm configuration
(use-package helm
:ensure t
:bind
("M-x" . helm-M-x)
const https = require('https')
const haversine = (a, b) => {
const R = 6373044
const { cos, sin, sqrt, PI, asin } = Math
const toRad = x => x * PI / 180
const dLat = toRad(a.lat - a.lon)
const dLon = toRad(b.lat - b.lon)
@menxit
menxit / Docker_UFW_IPTABLES.md
Last active November 2, 2020 08:20
Docker UFW and iptables
  1. Disable iptables
$ sudo vim /etc/docker/daemon.json
{
  "iptables": false
}
@menxit
menxit / .spacemacs
Created April 6, 2018 21:12
.spacemacs
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory