Skip to content

Instantly share code, notes, and snippets.

View cmditch's full-sized avatar
🥑

Coury Ditch cmditch

🥑
View GitHub Profile
@cmditch
cmditch / DebounceThrottler.elm
Created June 24, 2020 16:19
elm-debounce-throttler
module Data.Debouncer exposing
( Config
, Debouncer
, Msg
, cancel
, init
, poke
, update
)
@cmditch
cmditch / elm-ui-hacks.elm
Last active April 27, 2020 18:54
elm-ui hacks and utils
-- Example of a top level view, with flexbox bug fix, modal support, etc.
view : Model -> Browser.Document Msg
view model =
{ title = pageTitle model
, body =
[ Element.layoutWith options
[ inFront (Dialog.view model.dialog) ]
(appView model)
-- TODO Remove this fix if elm-ui 1.1.6 fixes the flexbox bug
@cmditch
cmditch / funTimes.js
Created April 7, 2020 06:05
Javascript, the language of the browser first and foremost
function funTimes() {
let elements = document.getElementsByTagName('p');
let counter = 0;
setInterval(function() {
for (let i = 0; i < elements.length; i++) {
generateRainbowText(elements[i], counter);
}
counter++;
}, 200)
@cmditch
cmditch / ds.sol
Created June 16, 2019 03:28
K. Done.
contract DominantAssuranceContract {
address owner;
uint256 deadline;
uint256 goal;
uint8 percentagePayoff;
mapping(address => uint256) public balanceOf;
uint256 totalPledges;
constructor(uint256 numberOfDays, uint256 _goal, uint8 _percentagePayoff) public payable {
owner = msg.sender;
@cmditch
cmditch / kata.hs
Last active May 23, 2019 02:10
What I have so far... but doesn't quite work
module Codewars.Kata.SqIntoSq where
import Debug.Trace
decompose :: Integer -> Maybe [Integer]
decompose num = decomposer (num^2) (num-1)
decomposer :: Integer -> Integer -> Maybe [Integer]
decomposer total num =
case (num, squareSum list == total) of
@cmditch
cmditch / cdffc94-build-error.txt
Created May 21, 2019 01:16
Error while building on macOS (hevm commit cdffc94)
Preprocessing library for hevm-0.30..
Building library for hevm-0.30..
clang-5.0: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
In file included from ethjet/ethjet-ff.cc:6:0: error:
In file included from /nix/store/k4im5gvnhivvinhaqnbynljlzjvavqka-libff-0.20181030/include/libff/algebra/fields/bigint.hpp:17:0: error:
In file included from /nix/store/k4im5gvnhivvinhaqnbynljlzjvavqka-libff-0.20181030/include/libff/common/serialization.hpp:104:0: error:
<?xml version="1.0" ?><svg enable-background="new 0 0 226.777 226.777" height="100px" id="Layer_1" version="1.1" viewBox="0 0 226.777 226.777" width="100px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g>
<polygon fill="#5A6378" points="112.553,157 112.553,86.977 44.158,116.937 "/>
<polygon fill="#7FD13B" points="112.553,82.163 112.553,-0.056 46.362,111.156 "/>
<polygon fill="#60B5CC" points="116.962,-0.09 116.962,82.163 184.083,111.566 "/>
<polygon fill="#F0AD00" points="116.962,86.977 116.962,157.002 185.405,116.957 "/>
<polygon fill="#60B5CC" points="112.553,227.406 112.553,171.085 44.618,131.31 "/>
<polygon fill="#7FD13B" points="116.962,227.406 184.897,131.31 116.962,171.085 "/></g></svg>

Keybase proof

I hereby claim:

  • I am cmditch on github.
  • I am cmditch (https://keybase.io/cmditch) on keybase.
  • I have a public key ASCHsJpdw1mQ73sqlouzmjDOog9WofX1KK6weSsYGQGniQo

To claim this, I am signing this object:

pragma solidity ^0.4.24;
// All of this is confirmed working within remix, and geth, but freezes up hevm.
// See here for testing with `hevm` and `dapp test`
/////////////////////////////
// Start of proxy contract
//
pragma solidity ^0.4.24;
import "../lib/ds-test/src/test.sol";
/// @title Proxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.
/// @author Stefan George - <stefan@gnosis.pm>
// Mix this into contracts you'd like to be "proxyable",
// masterCopy must be the first var in any proxied contract in order to work correctly.