Skip to content

Instantly share code, notes, and snippets.

View ndp's full-sized avatar

Andy Peterson ndp

View GitHub Profile
: aani|i ann . _ . _ _ . . . | . . . _ _ . _ .
2: ad|un . _ _ . . | . . _ _ .
2: ada|nun . _ _ . . . _ | _ . . . _ _ .
: adad|un un . _ _ . . . _ _ . . | . . _ _ . . . _ _ .
: adai|i nun . _ _ . . . _ . . | . . _ . . . _ _ .
: adai|in un . _ _ . . . _ . . | . . _ . . . _ _ .
: adapis|sip nun . _ _ . . . _ . _ _ . . . . . . | . . . . . . _ _ . _ . . . _ _ .
: adati|it nun . _ _ . . . _ _ . . | . . _ _ . . . _ _ .
: adatom|mot nun . _ _ . . . _ _ _ _ _ _ _ | _ _ _ _ _ _ _ . . . _ _ .
: adaunt|tad nun . _ _ . . . _ . . _ _ . _ | _ . _ _ . . _ . . . _ _ .
@ndp
ndp / Tile.jsx
Created November 11, 2021 00:31
React testing example, November 2021
/**
* Simple component that gets its data (things) from another
* service, `thing-api-service`.
*/
import { getThings } from './thing-api-service'
import * as React from 'react'
export const Tile = () => {
const [things, setThings] = React.useState([])
@ndp
ndp / typescript-helpers.bash
Last active August 1, 2021 22:41
Useful script for working with typescript
# Upgrade all typescript types in a project
yarn outdated | grep @types | awk '{print $1}' | xargs yarn upgrade
@ndp
ndp / monty_hall.rb
Last active February 22, 2020 20:41
Simulate the Monty Hall problem in Ruby
class MontyHall
DOORS = 0..2
def initialize
@car = rand(DOORS)
end
def pick
@pick = rand(DOORS)
end
#!/usr/bin/env ruby
#
# Convert blogger (blogspot) posts to jekyll posts
#
# Basic Usage
# -----------
#
# ./blogger_to_jekyll.rb feed_url
#
# where `feed_url` can have the following format:
@ndp
ndp / angularStyle2.coffee
Last active December 19, 2015 06:59
Sample code for blog post http://blog.ndpsoftware.com/2013/07/javascript-dependency-injection.html See `everything-spec.coffee` for a working spec with all the samples within it.
nightService = ['alarmService', 'sleepService', (alarmService, sleepService) ->
(i, awake) ->
"#{sleepService(i)} #{alarmService()} #{awake}"
]