Skip to content

Instantly share code, notes, and snippets.

View Stanback's full-sized avatar

Brian Stanback Stanback

  • Demand.io
  • Los Angeles, California
View GitHub Profile
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
import "./Car.sol";
// The strategy used to reach #5 (1486.41 ELO) in 0xMonaco
// https://twitter.com/0xBA5ED
// This contract contains bugs and has ineffecient gas usage, do not use it in production
contract BA5ED is Car {
uint256 internal constant PANIC_MODE_MOVES = 5;
@Uvacoder
Uvacoder / coloring-with-code-image-palette-extraction.markdown
Created December 27, 2021 09:52
Coloring With Code — Image Palette Extraction
@sindresorhus
sindresorhus / esm-package.md
Last active April 23, 2024 09:02
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@petejkim
petejkim / USDCFaucet.sol
Created September 17, 2020 14:32
USDC Faucet in Goerli
// SPDX-License-Identifier: MIT
// Copyright (c) 2020 petejkim
pragma solidity 0.6.12;
import { Ownable } from "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.2.0/contracts/access/Ownable.sol";
import { IERC20 } from "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.2.0/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.2.0/contracts/token/ERC20/SafeERC20.sol";
contract USDCFaucet is Ownable {
@aliostad
aliostad / stockfish-interface.txt
Created August 17, 2019 10:41
stockfish - Description of the universal chess interface (UCI)
COPIED FROM https://build.opensuse.org/package/view_file/games/stockfish/stockfish-interface.txt?expand=1
Description of the universal chess interface (UCI) April 2006
=================================================================
* The specification is independent of the operating system. For Windows,
the engine is a normal exe file, either a console or "real" windows application.
* all communication is done via standard input and output with text commands,
@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active March 28, 2024 01:45
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
with detection_graph.as_default():
with tf.Session(graph=detection_graph) as sess:
image_tensor = detection_graph.get_tensor_by_name('image_tensor:0')
detection_boxes = detection_graph.get_tensor_by_name('detection_boxes:0')
detection_scores = detection_graph.get_tensor_by_name('detection_scores:0')
detection_classes = detection_graph.get_tensor_by_name('detection_classes:0')
num_detections = detection_graph.get_tensor_by_name('num_detections:0')
for image_path in TEST_IMAGE_PATHS:
image = Image.open(image_path)
image_np = load_image_into_numpy_array(image)
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from PIL import Image
import numpy as np
input_test_img = '/your/path/Utah_AGRC-HRO_15.0cm_12TVK220980-CROP.0.0.jpg'
im = np.array(Image.open(input_test_img), dtype=np.uint8)
# Create figure and axes
fig,ax = plt.subplots(figsize=(10, 10))
@gricard
gricard / webpack4upgrade.md
Last active February 29, 2024 20:23
Just some notes about my attempt to upgrade to webpack 4

If you enjoyed reading this, I'm intending to do more blogging like this over here: https://cdgd.tech

This is not a complaint about Webpack or v4 in any way. This is just a record of my process trying it out so I could provide feedback to the webpack team

Hmm... I don't see any docs for 4.0 on https://webpack.js.org. I guess I'll just wing it. All I need to do is npm i -D webpack@next, right?

+ webpack@4.0.0-beta.2
@primaryobjects
primaryobjects / css-comparison.csv
Last active August 7, 2023 13:16
A comparison of CSS library sizes.
Name Version Size (uncompressed) Size (minified) Size (gzipped) URL
Bootstrap v3.3.7 143 KB 117 KB 20 KB http://getbootstrap.com/css/
Bootstrap v4.0.0 187 KB 147 KB 20 KB https://v4-alpha.getbootstrap.com/
Materialize v3.0 114 KB 90 KB 18 KB http://materializecss.com/
Material Design Lite v1.3.0 350 KB 137 KB 21 KB https://getmdl.io/
mini.css v2.1 47 KB 36 KB 7 KB https://chalarangelo.github.io/mini.css/
Semantic UI v2.2.6 730 KB 550 KB 95 KB https://semantic-ui.com/
Foundation v3.0 90 KB 64 KB 12 KB http://foundation.zurb.com/
Pure CSS v0.6.2 80 KB 17 KB 3.8 KB https://purecss.io/
Picnic CSS v6.3.2 55 KB 38 KB 7 KB https://picnicss.com