Skip to content

Instantly share code, notes, and snippets.

@jwalton
jwalton / tarball-name.sh
Last active December 20, 2015 13:38
Generate a platform-specific tarball name
#!/bin/bash
# Print usage instructions.
printUsage() {
cat <<END
usage: `basename $0` [-hv] [-s version] [-p prefix]
where:
prefix - The filename prefix to use in generating the tarball name.
version - The version number to use in generating the tarball name.
@jwalton
jwalton / README.md
Created September 16, 2013 01:55
Demonstration of mongoose streaming + longjohn causing sadness

To reproduce:

  • Copy the files below
  • npm install
  • ./node_modules/.bin/coffee app.coffee

Set "repoProblem" to true to make the problem happen, and to false to make the app run WAY faster and not run out of memory. :)

@jwalton
jwalton / README.md
Last active December 5, 2016 08:12 — forked from chelsea/README.md

Description

Dashing widget to display a random cute picture from http://reddit.com/r/aww

The display of the widget is heavily based on the Image widget, however it does not prepend the src with 'assets' which allows for external images.

Settings

You can set a placeholder image in the event that reddit is down, or otherwise unresponse. This is set at the top of random_aww.rb as follows:

@jwalton
jwalton / OC Transpo for Dashing.md
Last active March 26, 2019 19:24
OC Transo widget for Dashing

Fetches times for the next buses at a given OC Transpo stop.

Add the following to your gemspec:

gem 'octranspo_fetch', '>= 0.0.4'

Screen Shot

Then configure the constants at the top of oc_transpo.rb.

@jwalton
jwalton / Dashing EC2.md
Last active October 10, 2019 04:47
EC2 CloudWatch stats for Dashing

Get EC2 CloudWatch stats and graph them in Dashing.

@jwalton
jwalton / REAMDE.md
Last active March 27, 2020 10:28 — forked from james/REAMDE.md
Pingdom widget for Dashing

Description

Simple Dashing widget (and associated job) to display Pingdom checks.

##Dependencies

rest-client

Add it to dashing's gemfile:

A Dashing widget which shows an image.

To use, in your dashboard.erb file:

<li data-row="1" data-col="1" data-sizex="3" data-sizey="2">
  <div data-id="picture" data-view="BigImage" data-image="http://i.imgur.com/JycUgrg.jpg"
    style="background-color:transparent;"
    data-max="true"
  ></div>
@jwalton
jwalton / useWhyRender.tsx
Created June 18, 2020 16:00
A react hook to figure out why a component is rendering
/* tslint:disable:no-console */
import ld from 'lodash';
import React from 'react';
/**
* Use this hook to figure out why a React component is re-rendering.
* It will log if any properties in `props` have changed. You should
* also pass any state variables into `props` as well.
*
@jwalton
jwalton / prefixFormat.ts
Created June 24, 2020 20:23
Winston Formatters
import * as path from 'path';
export interface PrefixFormatOptions {
basepath?: string;
}
/**
* This is a debug format, used to prefix the message with tags and filenames.
*
* This copies values to `message`, and strips values out of the `info` so
@jwalton
jwalton / Github Milestone Dashing Widget.md
Last active July 30, 2020 23:17
Dashing Widget to Display Next Git Milestone

This will show your next GitHub milestone as a Dashing widget. Built on top of the Text widget.

To use:

  • Add the following to your gemfile:

  •   gem 'rest-client'
    
  • Replace the git_token, git_owner, and git_project in git-milestone.rb as appropriate.