Skip to content

Instantly share code, notes, and snippets.

@ageyev
ageyev / vite.config.ts
Created August 15, 2023 03:02
vite.config.ts for react app -> gitlab pages
import { defineConfig } from "vitest/config";
import react from "@vitejs/plugin-react";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
server: {
open: true
},
base: "./",
@ageyev
ageyev / static.yml
Created August 15, 2023 02:46
.github/workflows/static.yml
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
@ageyev
ageyev / .vimrc
Last active August 22, 2023 10:58
minimal .vimrc
set nocompatible
"to get the File, Open dialog box to default to the current file's directory
set browsedir=buffer
" Change Working Directory to that of the current file
cmap cwd lcd %:p:h
cmap cd. lcd %:p:h
cmap w!! w !sudo tee % >/dev/null
pragma solidity ^0.4.15;
contract StringsAndBytes {
/* --- public variables for storing tests results */
string public lastTestStringResult; //
bytes32 public lastTestBytes32Result; //
bytes public lastTestBytesResult; // bytes: dynamically-sized byte array
bool public lastTestBoolResult; //
package net.cryptonomica.web3j;
import org.web3j.abi.FunctionEncoder;
import org.web3j.abi.TypeReference;
import org.web3j.abi.datatypes.Function;
import org.web3j.abi.datatypes.Type;
import org.web3j.abi.datatypes.Utf8String;
import org.web3j.abi.datatypes.generated.Uint256;
import org.web3j.protocol.core.methods.response.TransactionReceipt;
@ageyev
ageyev / ProofOfExistence.sol
Created July 11, 2016 09:31
This smartcontract is used to store documents text on the Ethereum blockchain and to get the document by document's hash (sha256).
/*
This smartcontract is used to store documents text on the Ethereum blockchain
and to get the document by document's hash (sha256).
*/
contract ProofOfExistence{
/* ---- Public variables: */
string public created;
@ageyev
ageyev / Verificator.sol
Created June 10, 2016 11:24
Smart contract for Ethereum's account owner verification using Cryptonomica.net notary verified OpenPGP public key
/*
Usage:
1. Account owner sends a request for verification, in this request he sends a fingerprint of his OpenPGP key stored on cryptonomica.net
2. This contracts sends back a string to sign
3. Accont owener signs this strign with his OpenPGP key and sends back to smartcontract.
4. Information about verification is public visible - who needs to check can download verified public key from cryptonomica.net and check if owner of stated Ehereum acconts is also known owner of verified OpenPGP key on cryptonomica.net
It's also possible to create a web-inerface using Cryptonomica's API like:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
gh_url = 'https://api.github.com'
req = urllib2.Request(gh_url)
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()