Skip to content

Instantly share code, notes, and snippets.

View jefflau's full-sized avatar
🏪
Working from Taipei

Jeff Lau jefflau

🏪
Working from Taipei
View GitHub Profile
@jefflau
jefflau / Ticketer.sol
Last active November 13, 2017 19:07
Ticketer.sol
contract Ticketer {
address owner;
uint tickets;
uint sellStartDate;
uint sellEndDate;
uint eventStartDate;
uint buffer;
uint maxTicketsPerAddress;
0x19bC8Ee574bbF9a591CdfF271971155d8445Ef54
0x866B3c4994e1416B7C738B9818b31dC246b95eEE
@jefflau
jefflau / package.json
Created April 3, 2018 05:21
Prettier config
"prettier": {
"semi": false,
"editor.formatOnSave": true,
"singleQuote": true
}
@jefflau
jefflau / modulate.js
Created June 15, 2018 09:49
Modulate function - good for parallax on scroll or movement on scroll
export function modulate(value, rangeA, rangeB, limit) {
let fromHigh, fromLow, result, toHigh, toLow
if (limit == null) {
limit = false
}
fromLow = rangeA[0]
fromHigh = rangeA[1]
toLow = rangeB[0]
toHigh = rangeB[1]
result = toLow + ((value - fromLow) / (fromHigh - fromLow)) * (toHigh - toLow)
### Keybase proof
I hereby claim:
* I am jefflau on github.
* I am jefflau (https://keybase.io/jefflau) on keybase.
* I have a public key ASB76SCxW1qF2yWjmO_ffbhDiIoFL50sQn1NZkAwgSA_8wo
To claim this, I am signing this object:
[
{
"constant": true,
"inputs": [
{
"name": "node",
"type": "bytes32"
}
],
"name": "resolver",
[
{
"constant": false,
"inputs": [
{
"name": "_hash",
"type": "bytes32"
}
],
"name": "releaseDeed",
@jefflau
jefflau / ensTypes.graphql
Last active September 26, 2018 15:26
ensTypes.graphql
type Address {
address: String
}
type Node {
name: String
nameHash: String
label: String
node: String
subNodes: [Node]
@jefflau
jefflau / mediaQuery.js
Last active October 14, 2018 01:31
mediaQuery.js
import { css } from 'styled-components'
const sizes = {
giant: 1170,
desktop: 992,
tablet: 768,
phone: 376
}
// iterate through the sizes and create a media template