Skip to content

Instantly share code, notes, and snippets.

View willwillis's full-sized avatar

Will Willis willwillis

View GitHub Profile
@willwillis
willwillis / descriptions.json
Created September 10, 2024 16:42 — forked from stellasphere/descriptions.json
WMO weather interpretation code descriptions (& images)
{
"0":{
"day":{
"description":"Sunny",
"image":"http://openweathermap.org/img/wn/[email protected]"
},
"night":{
"description":"Clear",
"image":"http://openweathermap.org/img/wn/[email protected]"
}
@willwillis
willwillis / technicolor.pl
Created October 15, 2021 13:42
Joseph's Technicolor Dreamcoat Colors
#/usr/bin/perl
use strict;
foreach my $line (<DATA>) {
my ($name, $hex) = split(/\s+/,$line);
print qq~<div style="background-color:$hex; display:inline; padding: 3em; float:left">$name</div>~;
}
__DATA__
red #ff0000
@willwillis
willwillis / prisma-where-clause.ts
Created July 12, 2021 20:56
Where clause on DateTime field, Prisma Client
import { PrismaClient, Prisma } from '@prisma/client';
const prisma = new PrismaClient();
async function main() {
const user = await prisma.user.findMany({
where: {
createdAt: {
gte: '2020-07-20T22:17:24.915Z'
}
@willwillis
willwillis / crontab_header.sh
Created December 10, 2020 06:02 — forked from wesleyit/crontab_header.sh
A default crontab header that will make the life easier for those who don't remember cron fields or keywords.
## CRONTAB HINTS AND TIPS
##
##
## Entry Description Equivalent To
## @yearly (or @annually) Run once a year at midnight in the morning of January 1 0 0 1 1 *
## @monthly Run once a month at midnight in the morning of the first of the month 0 0 1 * *
## @weekly Run once a week at midnight in the morning of Sunday 0 0 * * 0
## @daily Run once a day at midnight 0 0 * * *
## @hourly Run once an hour at the beginning of the hour 0 * * * *
## @reboot Run at startup @reboot
@willwillis
willwillis / ABCToken.sol
Created November 26, 2020 02:01 — forked from HaoyangLiu/ABCToken.sol
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.4+commit.1dca32f3.js&optimize=true&gist=
pragma solidity 0.6.4;
import "./Context.sol";
import "./IERC20.sol";
import "./SafeMath.sol";
import "./Ownable.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
@willwillis
willwillis / index.html
Created January 22, 2020 20:34
SVG Pattern Doodler
<div id="container" class="borderimg"></div>
pragma solidity ^0.5.0;
import "./FDIC_Coin.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/crowdsale/Crowdsale.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/crowdsale/emission/MintedCrowdsale.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/crowdsale/validation/CappedCrowdsale.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/crowdsale/validation/TimedCrowdsale.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/crowdsale/distribution/RefundablePostDeliveryCrowdsale.sol";
// @TODO: Inherit the crowdsale contracts
pragma solidity ^0.5.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20Detailed.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20Mintable.sol";
contract MyToken is ERC20, ERC20Detailed, ERC20Mintable {
constructor(
string memory name,
string memory symbol
#!/usr/bin/env bash
conda deactivate
conda update conda
conda create -n mlenv python=3.7 anaconda
conda activate mlenv
conda install -c conda-forge nodejs
conda install -c pyviz hvplot
conda install -c plotly plotly
conda install -c plotly plotly_express==0.4.1
pragma solidity ^0.5.10;
contract Lassie {
// STATE VARIABLES
uint8 public contractState; // 1 = OK 2 = WARNING 3 = CRITICAL
uint8 public responderState; // 1 = OK 2 = PREPPED 3 = RESPOND
// RESPONDER Payment Amounts
uint256 public responderPrepAmount = 1 wei;
uint256 public responderRespondAmount = 2 wei;