Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style type="text/css">
html {
height: 100%;
padding: 0;
<html>
<head>
<script type="text/javascript">
// Your Client ID can be retrieved from your project in the Google
// Developer Console, https://console.developers.google.com
var CLIENT_ID = '469780497507-emil5hs8k93ro3fnpqqe8guvejsrj884.apps.googleusercontent.com';
var SCOPES = [/*'https://www.googleapis.com/auth/drive', */'https://www.googleapis.com/auth/drive.appfolder', 'https://www.googleapis.com/auth/drive.file'];
/**
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<style>
body {
}
import './AnimatedNumber.scss';
import React from 'react';
export class AnimatedNumber extends React.Component {
number;
nextNumber;
static mountElements = 0;
static vendorTransform;
ffprobe -show_frames -of compact=p=0 -f lavfi "movie=chappy.mkv,select=gt(scene\,.4)" > foo.txt
import './AnimatedNumber.scss';
export class AnimatedNumber extends zx.react.Component {
isAnimation = false;
duration = 1000;
oldValue = this.props.value;
oldRawValue = +this.props.rawValue || +this.props.value;
currentValue = this.props.value;
currentRawValue = +this.props.rawValue || +this.props.value;
nextValue;
type Resolve<T> = (value?: T | PromiseLike<T> | undefined) => void;
type Reject = (reason?: any) => void;
type AbortFn = ((onCancel: ()=>void)=>void) | undefined;
type OnFullfilled<T, TResult> = (value: T) => TResult | PromiseLike<TResult>;
type OnRejected<T, TResult> = (reason: any) => TResult | PromiseLike<TResult> | void;
type Executor<T> = (resolve: Resolve<T>, reject: Reject, onCancel?: AbortFn) => void
export class CancellablePromise<T>{
cancelled = false;
type Resolve<T> = (value?: T | PromiseLike<T> | undefined) => void;
type Reject = (reason?: any) => void;
type AbortFn = ((onCancel: () => void) => void) | undefined;
type Executor<T> = (resolve: Resolve<T>, reject: Reject, onCancel?: AbortFn) => void
export class CancellablePromise<T> implements Promise<T> {
cancelled = false;
children?: CancellablePromise<{}>[] = undefined;
promise: Promise<T>;
onCancel?: ()=>void;
parent: CancellablePromise<{}>;
@cevek
cevek / Promise.ts
Last active September 23, 2016 16:00
type Opt<T> = T | undefined | void | null;
type Any = any;
type This = Any;
type Arg = Any;
type PDef = P<Any>;
type Callback<R, T> = Opt<(<R>(val: T, arg: Arg) => R | P<R>)>;
const enum PromiseState{
PENDING,
@cevek
cevek / dao.ts
Last active September 29, 2016 17:04
interface FindParams {
attrs?: string;
sql?: string;
where?: any;
model?: DAO<any>;
include?: (DAO<any> | FindParams)[];
values?: any[],
orderBy?: string;
}