Skip to content

Instantly share code, notes, and snippets.

View levino's full-sized avatar

Levin Keller levino

View GitHub Profile
@levino
levino / resume.json
Created April 18, 2023 09:14
Levin Kellers resume
{
}
@levino
levino / examples.ts
Created December 19, 2018 08:54
Example for linting rules.
type standardFunction = (arg1: number, arg2: number) => number
// Should be okay
const add: standardFunction = (arg1, arg2) => arg1 + arg2 // Types can be inferred from 'standardFunction'
const addLater = (
arg1: number,
arg2: number
): (() => Promise<number>) => async () => arg1 + arg2 // Return type of promise can be inferred from type definition of 'addLater'
// Should not be okay
@levino
levino / linkSendForm.tsx
Last active November 9, 2018 22:12
Link that submits form.
import * as R from 'ramda'
import * as React from 'react'
import { ReactElement } from 'react'
import { connect } from 'react-redux'
import { State } from 'src/selectors'
import * as urlJoin from 'url-join'
import * as selectors from '../../../selectors'
const API_URL =
process.env.REACT_APP_API_URL ||
`https://api.example.com/.netlify/functions`
@levino
levino / scrypt+6.0.3.patch
Created September 7, 2018 14:32
Patch scrypt to load with webpack
diff --git a/node_modules/scrypt/index.js b/node_modules/scrypt/index.js
index 7b13a79..1e40d76 100644
--- a/node_modules/scrypt/index.js
+++ b/node_modules/scrypt/index.js
@@ -1,6 +1,6 @@
"use strict";
-var scryptNative = require("./build/Release/scrypt")
+var scryptNative = require("./build/Release/scrypt.node")
, Crypto = require("crypto")
@levino
levino / bn.js.d.ts
Created May 29, 2018 09:58
Type Definitions for Web3 1.0.0-beta33
declare module 'bn.js' {
type Endianness = 'le' | 'be';
class BN {
constructor(
inputNumber: number | string | number[] | Buffer,
base?: number,
endian?: Endianness
);
clone(): BN;
toString(base?: number, length?: number): string;