Skip to content

Instantly share code, notes, and snippets.

View adrianbarwicki's full-sized avatar

Adrian Barwicki adrianbarwicki

View GitHub Profile
# Will create a histogram for the first MOST_FREQUENT_LIMIT frequent occurances of words in the words.txt
from collections import Counter
import numpy as np
import matplotlib.pyplot as plt
# How many bars in the histogram?
MOST_FREQUENT_LIMIT=8
with open("./words.txt", "r") as f:
@adrianbarwicki
adrianbarwicki / image-parser-markdown.ts
Created November 20, 2019 20:49
Extracts the first image url from a markdown text
/**
Extracts the first image url from a markdown text
Copyright 2019 Adrian Barwicki
*/
const IMAGE_EXTENSIONS = ["jpeg", "jpg", "png", "gif"];
const getExtension = (path: string): string => {
return path.split(".").pop();
};
/**
* `map-array-with-observables.ts`
* Maps an array onto an extended one with data from external requests.
*
* Compile it with `tsc test.ts --lib es2015`.
* Run it with `node test.js`.
*
* Copyright Adrian Barwicki 2019
* adrian@adrianbarwicki.com
*/
pragma solidity ^0.4.0;
/// @title PonziFund
/// @author adrianbarwicki
contract PonziFund {
address public owner;
uint public total;
mapping (address => uint) public invested;
mapping (address => uint) public balances;