View CallFormEditable.user.js
// ==UserScript== | |
// @name Call Form Editable Still | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Make all View Buttons Edit Buttons | |
// @author You | |
// @match https://ic.bdsmarketing.com/IC.DataCollection/HoursCollection.aspx* | |
// @grant none | |
// ==/UserScript== |
View CallFormEditable.js
// ==UserScript== | |
// @name Call Form Editable Still | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Make all View Buttons Edit Buttons | |
// @author You | |
// @match https://ic.bdsmarketing.com/IC.DataCollection/HoursCollection.aspx* | |
// @grant none | |
// ==/UserScript== |
View HOF1.ts
type ITask<I: $ReadOnlyArray<mixed>, O> = { | |
(...r: I): ?O, | |
lastError?: Error | |
} | |
function task <I: $ReadOnlyArray<mixed>, O>(inner: (...r: I) => O): ITask<I, O> { | |
const wrapped: any = function wrapped() { | |
try { | |
return (inner: any).apply(this, arguments) | |
} catch (err) { |
View $HOC.ts
type HOC<InjectedProps, ExtraProps, Args: $ReadOnlyArray<*>> = <D, P, C: React$Component<D, P, any>>( | |
component: Class<C>, | |
...rest: Args | |
) => Class<React$Component<D, $Diff<P, InjectedProps> & ExtraProps, any>>; | |
declare var injectName: HOC<{name: string}, {bla: Array<number>}, [string, number]>; | |
type Props = { | |
name: string, | |
age: number, |
View HaskellySkewHeap.swift
// https://en.wikipedia.org/wiki/Skew_heap#Implementation | |
import Foundation | |
indirect enum SkewHeap<T> where T: Equatable, T: Comparable { | |
case Empty | |
case Node(T, SkewHeap<T>, SkewHeap<T>) | |
} | |
func singleton<T>(_ a: T) -> SkewHeap<T> where T: Equatable, T: Comparable { | |
return .Node(a, .Empty, .Empty) |
View $Values.ts
// @flow | |
/* | |
This magic type will give you the union of the types of all the values in an object type. | |
This is still far from a fully dynamic $PropertyType, but it's a lot better than just using `any` | |
*/ | |
/* | |
Link: | |
https://flow.org/try/#0C4TwDgpgBAJA8gIwFYQMbADwDUB8UC8UA3gNQDaA1hCAFxQDOwATgJYB2A5gLp1YC+AKFCQoAfRhYAhgBsArhHrYANFDh14yNJlx5CWIeGgSZ8xWtWb0uscbkKMAKhVwcAt8OiIkBYgKhQSVDo2WQBbBAgmJT8AhDpGVk5o-xJJOgQAewzpCEk2aMEBABM0aUkmaAA3cqhaWCk7M2RXAG4ACjqE9g4oAB8oTOzctj6oEPDIgEo3AHoZ9rqAQSYmSRAMcYimHEmoOagAURWMpgYACwyAdxHUE4r0aRAoM8iIATmF4LCt0a7OXf2RyYJ3OVxudy0j2er3e8w6XwmTABM0Ox1O9Au1ygtxWkKeLwqsM+AyyOTyyNRwPRmPBuIe+JhH3hDGY3QpQJBGLB2Ih9OhhKAA | |
*/ |
View $NonNull.ts
/* @flow */ | |
type _NonNull<T, N: ?T> = T | |
type $NonNull<N> = _NonNull<*, N> | |
type Num = $NonNull<?number> | |
;(45: Num) | |
// $ExpectError | |
;(undefined: Num) |
View $Value.ts
/* eslint-disable */ | |
// @flow | |
type $ObjectPair<K, V> = {[key: K]: V} | Object | |
type _$Value<Key: string, V, O: $ObjectPair<Key, V>> = V | |
type $Value<O: Object, K: $Keys<O>> = _$Value<K, *, O> | |
type Obj = { | |
c: number, | |
b: boolean, |
View FunctionValue.ts
/* @flow */ | |
type $Function1<A, B> = (arg: A) => B; | |
type _Function1Value<A, B, F: $Function1<A, B>> = B; // eslint-disable-line | |
type $Function1Value<F: $Function1<*, *>, A> = _Function1Value<A, *, F>; | |
var toString = (value) => String(value) | |
var toNumber = (value) => parseFloat(value) || 0 | |
type NumberXString = ((value: number) => string) & ((value: string) => number) |
View .zshrc
# PREREQUISITES: | |
# install docker | |
# git clone antigen into your home folder. Should be able to find $HOME/antigen.zsh | |
# install rvm | |
# git clone zsh-autosuggestions into ~/.zsh/ | |
# so `source ~/.zsh/zsh-autosuggestions/autosuggestions.zsh` works. | |
# Switch terminal to zsh instead of bash | |
export BROWSER_SYNC_HOSTNAME=<USERNAMEHERE>.dev.agkn.net | |
export GOPATH=$HOME/go-packages/ |
NewerOlder