Skip to content

Instantly share code, notes, and snippets.

View rjz's full-sized avatar
👋
Hey there!

RJ Zaworski rjz

👋
Hey there!
View GitHub Profile

What's so great about Reason?

PDXReactJS meetup / 13. Nov 2018 @benjamminj

Maintainability?

We want to make complex problems simple, and solve them in ways we can extend on.

JavaScript v. ReasonML:

@rjz
rjz / strict_null_checks.sh
Created February 26, 2021 18:41
Find TypeScript files that fail with --strictNullChecks enabled
#!/bin/bash
# Brute force search for TypeScript files in the current directory that fail
# the `--strictNullChecks` flag. YMMV.
# edit this function to exclude files that _shouldn't_ be checked.
filter_defs() {
grep -v node_modules \
| grep -v '.d.ts$' \
| sort \
@rjz
rjz / apis.md
Last active February 14, 2021 15:01
APIs: the good, the bad, and the ugly

APIs: the good, the bad, and the ugly

  • Michele Titolo @micheletitolo
  • Who's built, designed, and spec'd a lot of APIs
  • Talk will focus on web APIs, but applies to many programmatic APIs, too

Documentation

  • good: it exists (and bonus points if it's interactive: I/O Docs is one nice example)
@rjz
rjz / import_route53_zone_to_terraform.sh
Created May 30, 2020 00:42
Translates an existing AWS Route53 zone into Terraform `aws_route53_record` resources.
#! /bin/bash
#
# Translates an existing AWS Route53 zone into Terraform `aws_route53_record` resources.
#
# Released under the MIT license; YMMV. Tested on Linux with:
#
# - jq-1.6
# - terraform v0.12.26
# - aws-cli/1.17.14
#
@rjz
rjz / cs-jq-plugin-template.coffee
Created September 3, 2012 17:01
Coffeescript jQuery Plugin Class Template
# A class-based template for jQuery plugins in Coffeescript
#
# $('.target').myPlugin({ paramA: 'not-foo' });
# $('.target').myPlugin('myMethod', 'Hello, world');
#
# Check out Alan Hogan's original jQuery plugin template:
# https://github.com/alanhogan/Coffeescript-jQuery-Plugin-Template
#
(($, window) ->
@rjz
rjz / tsc_strict_null_checks_ok.ts
Created February 12, 2020 17:42
List of strict null-checked files inside a TypeScript project
#!/bin/bash
# Returns a list of strict null-checked files inside the current directory.
# Useful for gradually introducing the `--strictNullCheck` flag to a
# TypeScript project.
#
# See: https://code.visualstudio.com/blogs/2019/05/23/strict-null
TS_FLAGS='--strictNullChecks --outDir=/dev/null'
@rjz
rjz / NOTES.md
Created October 15, 2019 01:58
New Relic FutureTalks 2019-10-14

Performance Antipatterns - Ben Evans ([@kittylyst][kittylyst]), New Relic

First, what's a pattern?

a model or design used as a guide in needlework and other crafts

-- OED

A model or design: patterns are more abstract than the substrate you're applying them to. Software's pretty abstract already, but design patterns are

@rjz
rjz / redux-actions-with-typescript-discriminated-unions.ts
Created September 29, 2016 16:00
Redux actions using TypeScript discriminated unions
// Redux actions using TypeScript discriminated unions
//
// Source: https://github.com/rjz/typescript-react-redux/
// Actions
export type Action =
{ type: 'INCREMENT_COUNTER', delta: number }
| { type: 'RESET_COUNTER' }
@rjz
rjz / pdx-reactjs-lightning-talks.md
Last active February 13, 2019 23:51
Lightning talks from the @pdxreactjs meetup on 2019-02-12.

PDXReactJS Lightning Talks

Lightning talks from the @pdxreactjs meetup on 2019-02-12.


A Better Approach to React Testing

Daniel Lemay - @dslemay

@rjz
rjz / pretty-date.rb
Created January 24, 2012 19:05
Pretty Date in Ruby
# Nothin' special here: just Resig's pretty date function ported to Ruby
# http://ejohn.org/blog/javascript-pretty-date/
def pretty_date(stamp)
now = Time.new
diff = now - stamp
day_diff = ((now - stamp) / 86400).floor
day_diff == 0 && (
diff < 60 && "just now" ||