Skip to content

Instantly share code, notes, and snippets.

View JofArnold's full-sized avatar

Jof JofArnold

View GitHub Profile
/**
*Submitted for verification at Etherscan.io on 2021-11-13
*/
pragma solidity ^0.8.0;
// SPDX-License-Identifier: MIT
/**
* @dev Interface of the ERC165 standard, as defined in the
@JofArnold
JofArnold / Dev.sol
Last active October 13, 2021 05:59
Developer DAO smart contract
/**
*Submitted for verification at Etherscan.io on 2021-08-27
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
@JofArnold
JofArnold / Loot.sol
Created September 19, 2021 08:51
@dhof's original Loot smart contract
/**
*Submitted for verification at Etherscan.io on 2021-08-27
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
@JofArnold
JofArnold / BoredApeYachtClub.sol
Last active April 9, 2023 12:44
The Bored Ape Yacht Club (BAYC) Solidity Smart Contract GitHub
/**
*Submitted for verification at Etherscan.io on 2021-04-22
*/
// File: @openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
@JofArnold
JofArnold / Fastfile
Last active July 5, 2021 09:21
Fastfile for creating apps on App Store Connect as well as certs, building and uploading to Testflight
# --------------------------------------------------------------------------------
#
# About
#
# Here is a useful Fastfile for delivering a multiple varients (targets) of an app
# to, ultimately, Testflight.
# The project is called "cione" and has two schemes and two targets called
# "cione" and "citwo".
@JofArnold
JofArnold / Login.m
Last active October 26, 2022 13:31
Using promises in React Native modules with Swift
// Created by react-native-create-bridge
// import RCTBridgeModule
#if __has_include(<React/RCTBridgeModule.h>)
#import <React/RCTBridgeModule.h>
#elif __has_include(“RCTBridgeModule.h”)
#import “RCTBridgeModule.h”
#else
#import “React/RCTBridgeModule.h” // Required when used as a Pod in a Swift project
#endif
@JofArnold
JofArnold / NavLink.js
Created February 1, 2018 18:58
React Router NavLink with inactiveClassName and isActive child function enhancements
@JofArnold
JofArnold / downshift-example.js
Last active October 9, 2023 04:43
Example of how to use Downshift as a controlled component with arbitrary items
// Untested code, but hopefully it gives you an idea.
// Ping me @jofarnold on Twitter if you get stuck
import React, { Component } from "react";
import Downshift from "downshift";
import PropTypes from "prop-types";
function nodeFromItem(id, items) {
return items.find(({ uuid }) => uuid === id);
}
@JofArnold
JofArnold / donut.js
Created September 29, 2017 09:49
Donut Chart using Styled Components
import React, { Component } from "react";
import PropTypes from "prop-types";
import styled from "styled-components";
const dimsFromProps = ({ size, strokeWidth, value }) => {
const halfsize = size * 0.5;
const radius = halfsize - strokeWidth * 0.5;
const circumference = 2 * Math.PI * radius;
const strokeVal = value * circumference / 100;
const dashVal = strokeVal + " " + circumference;

The problem with SASS mixins*

  1. mixins with SASS can balloon your css files quickly.
  2. mixins stop it being clear where stuff came from (can't search for class names for instance).

WARNING: The below is pseudo-code as I'm too lazy to double-check the APIs, output etc:

@mixin flexThing {
  color: red;