Skip to content

Instantly share code, notes, and snippets.

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on:
push:
branches: [ "main" ]
paths:
- 'content/**/*.md'
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
interface ICurvePool {
function A() external view returns (uint256);
function get_virtual_price() external view returns (uint256);
function calc_token_amount(uint256[3] calldata amounts, bool deposit)
external
const { ethers } = require("hardhat");
describe("Consumer", () => {
let consumer;
before(async () => {
const Consumer = await ethers.getContractFactory("Consumer");
consumer = await Consumer.deploy();
await consumer.deployed();
});
it("#counter1", async () => {
//SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.11;
contract Consumer{
uint256 public counter;
function counter1() public {
for(uint256 i; i<1000; i++){
counter = counter+i;
}
---
- hosts: all
become: yes
tasks:
- name: Update apt packages
apt:
upgrade: no
update_cache: yes
- name: Install packages for docker
version: '3'
networks:
default:
external:
name: front
services:
whoami:
image: containous/whoami
labels:
ARG rocksdb_version="6.15.2"
ARG ruby_version="2.7.2"
FROM golang:alpine as build-stage
ARG rocksdb_version
RUN apk add --update --no-cache build-base linux-headers git cmake bash perl
RUN apk add --update --no-cache zlib zlib-dev bzip2 bzip2-dev snappy snappy-dev lz4 lz4-dev zstd zstd-dev gflags
# Install Rocksdb
@tumf
tumf / unspent
Last active July 11, 2020 07:37
#!/bin/bash
# UTXO checker for Bitcoin mainnet
api=https://blockstream.info/api
function usage()
{
cat <<-EOF
usage: $(basename $0) tx_id index
EOF
}
@tumf
tumf / gistu
Last active July 26, 2020 02:30
#!/bin/bash
path=$1
go=$2
commands='gist grep diff cut mktemp'
for c in $commands; do
hash $c || { echo "install $c"; exit 255; }
done
if [ ! -r $path ]; then
@tumf
tumf / sshconf
Last active July 26, 2020 01:51
#!/bin/bash
command=$1
ssh_config_dir=~/.ssh
ssh_configs_dir=${ssh_config_dir}/conf.d
ssh_config_file=${ssh_config_dir}/config
ssh_base_config_file=${ssh_configs_dir}/config
function usage()
{
echo "Usage: `basename $0` [update [go]] [add user@ipaddress alias]"