This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
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(); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* `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 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |