Skip to content

Instantly share code, notes, and snippets.

View gnardini's full-sized avatar

Gonzalo Nardini gnardini

View GitHub Profile
@gnardini
gnardini / createLeaderboardImage.ts
Created May 7, 2023 00:18
Create an infographic from a template
import axios from "axios";
import fs from "fs";
import sharp from "sharp";
import text2png from "text2png";
import {
getLatestVersion,
updateLatestVersion,
} from "../src/staticData/version";
import { championImage, fetchChampions } from "../src/utils/champions";
const kit = await getContractKit()
const dollar = await kit.contracts.getStableToken(StableToken.cUSD);
const rewardsTransfers = await dollar.getPastEvents('Transfer', {
fromBlock: '0',
toBlock: 'latest',
filter: {
// from is a list of all the rewards contract addresses
from: ['0x811d62024653F95219Cd011F9058f79aCDa2Af0f', '0x7dA1bBa5f1C146A1873035CEEe216411B7fCa379', '0xa84172A779798e9b75131595614b3130E8E13Dc5'],
@gnardini
gnardini / ERC20.json
Created August 3, 2021 20:19
ERC20 ABI
[
{
"constant": true,
"inputs": [],
"name": "name",
"outputs": [{ "name": "", "type": "string" }],
"payable": false,
"stateMutability": "view",
"type": "function"
},
import React, { useEffect, useState, useRef } from 'react'
import { Animated, Easing } from 'react-native'
import PropTypes from 'prop-types'
const AnimatedNumber = ({ value, initialValue, animate, ...props }) => {
const [displayValue, setDisplayValue] = useState(initialValue)
const displayValueAnimation = useRef(new Animated.Value(initialValue)).current
useEffect(() => {
if (!animate) {
from xlrd import open_workbook
import re
import json
date_regex = re.compile('^[0-9][0-9]-[0-9][0-9]$')
new_page_regex = re.compile('^Página [0-9]+ de [0-9]+$')
def is_new_page(sheet, row, number_of_columns):
val = str(sheet.cell(row, 0).value)
if val.startswith('El importe adeudado'):
from flask import Flask, request
import os
from os.path import expanduser
app = Flask(__name__)
def expand(path):
if path.startswith('~'):
path = path[1:]
path = expanduser("~") + path
var opn = require('opn');
const POSTFIX = 18
var link = 'https://las.op.gg/multi/query='
var total = 0
var stdin = process.openStdin();
stdin.addListener("data", function(d) {
var l = d.toString().trim()
public class FixedSwipeRefreshLayout extends SwipeRefreshLayout {
private boolean mHandleTouch = true;
public FixedSwipeRefreshLayout(Context context) {
super(context);
}
public FixedSwipeRefreshLayout(Context context, AttributeSet attrs) {