Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block gwillz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
gwillz / moment-tags.js
Last active Sep 27, 2018
ES6 tagged template string for inline date fomatting
View moment-tags.js
* This doesn't _need_ to use moment.
* It's just the library that this project is using.
* Luxon or date-fns could also drop in neatly.
const moment = require('moment')
// This a bad name, as is 'format', so idk.
function inline(literals, {
let join = '';
View shm-typed-array.d.ts
/// <reference types="node" />
type Shm<T> = (T & { key: number });
type ShmMap = {
Buffer: Shm<Buffer>;
Int8Array: Shm<Int8Array>;
Uint8Array: Shm<Uint8Array>;
Uint8ClampedArray: Shm<Uint8ClampedArray>;
Int16Array: Shm<Int16Array>;
View connect-static-file.d.ts
declare module 'connect-static-file' {
import {Handler} from 'express'
import {SendOptions} from 'send'
interface Options extends SendOptions {
encoded?: string;
headers?: {[key: string]: string};
gwillz / react-leaflet.d.ts
Last active Aug 23, 2018
React-Leaflet type definitions for v2.0 (extension for existing @types/react-leaflet)
View react-leaflet.d.ts
import * as React from 'react'
import * as L from 'leaflet'
import 'react-leaflet'
declare module 'react-leaflet' {
export interface LeafletContext {
map?: L.Map,
pane?: string,
gwillz / draft-js-plugins.d.ts
Created Jul 5, 2018
Naive TypeScript support for draft-js-plugins
View draft-js-plugins.d.ts
/// <resources type="react" />
/// <resources type="draft-js" />
declare module "draft-js-plugins-editor" {
export type PluginsEditorProps = Draft.EditorProps | {
plugins: any,
export default class PluginsEditor
extends React.Component<PluginsEditorProps, Draft.EditorState> {}
You can’t perform that action at this time.