http://barisser.com/2015/10/consensus-and-identity/
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
// functional helper to execute every function in a list | |
// and return the value of the first function which not returns false | |
const firstResult = (...args) => functionList => | |
functionList.find(f => f(...args))(...args); | |
// Example (a stupid one): | |
const decisionList = [ | |
(a, b) => a > b ? 'a greater than b' : false, | |
(a, b) => a < b ? 'a smaller than b' : false, | |
() => 'a equal b', |
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
import ch.fhnw.util.math.Mat4; | |
import com.jogamp.opengl.*; | |
import com.jogamp.opengl.awt.GLCanvas; | |
import com.jogamp.opengl.util.FPSAnimator; | |
import java.awt.*; | |
import java.awt.event.WindowEvent; | |
import java.awt.event.WindowListener; | |
public class Lissajous implements WindowListener, GLEventListener{ |
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
module PictureASCII where | |
import Data.Char | |
-------------------------------------------------------------------------------- | |
-- 1) ASCII Pictures | |
-------------------------------------------------------------------------------- | |
-- A Picture is a list of strings. | |
type Picture = [String] | |
-- An example picture. Design a nicer one. |
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
enum ParticipationType { | |
INVEST | |
REDEEM | |
} | |
enum Opinion { | |
UnqualifiedOpinion | |
QualifiedOpinion | |
AdverseOpinion | |
DisclaimerOfOpinion |
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
adsf |
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
import React, { useEffect, useContext } from 'react'; | |
import Router from 'next/router'; | |
export const ScrollPositionContext = React.createContext({ | |
triggerScroll: () => null, | |
}); | |
export const useScrollPosition = () => useContext(ScrollPositionContext); | |
let routerBound = false; |
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.7.3; | |
import '@openzeppelin/contracts/access/Ownable.sol'; | |
import '@openzeppelin/contracts/math/SafeMath.sol'; | |
import '@openzeppelin/contracts/utils/Context.sol'; | |
import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; | |
import 'hardhat/console.sol'; |
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
import { Address, log } from "@graphprotocol/graph-ts"; | |
import { | |
ImplementationAdded, | |
} from "../generated/CallProxy/CallProxy"; | |
import { | |
ProxyEvent, | |
} from "../generated/schema"; |
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
let timeout; | |
const refresh = () => { | |
window.clearTimeout(timeout); | |
// do query | |
timeout = window.setTimeout(() => { | |
refresh(); | |
}, 10 * 1000); | |
}; |