Skip to content

Instantly share code, notes, and snippets.

View steveadams's full-sized avatar
😶‍🌫️

Steve steveadams

😶‍🌫️
View GitHub Profile
@steveadams
steveadams / typescript-dispatch-table-types.tsx
Created June 25, 2020 15:10
How to type disaptch maps in TypeScript?
// This is an attempt to understand how to solve this problem better.
// I have objects which I use as dispatch maps, or dispatch tables, however you like to call them.
// I want to type them so I'm certain I'm always using the right identifiers. Excuse the code, it's
// arbitrary but roughly describes how I'm using it.
const stringKeyedIcons: Record<string, Icon> = {
Facebook: () => { /* facebook icon */ },
Google: () => { /* google icon */ },
Twitter: () => { /* twitter icon */ },
}
Finished tests in 67.515450s, 1.0516 tests/s, 1.6441 assertions/s.
Failure:
UpdateAppointmentStatusJobTest#test_appointment_should_turn_to_late [/Users/steve/Work/dock/test/jobs/update_appointment_status_job_test.rb:25]
Minitest::Assertion: this should NOT change the appointment to late.
--- expected
+++ actual
@@ -1,2 +1 @@
-# encoding: US-ASCII
Steves-MacBook-Air:dock steve$ gem install nokogiri -v '1.9.1' --source 'https://rubygems.org/'
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
current directory: /Users/steve/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/nokogiri-1.9.1/ext/nokogiri
/Users/steve/.rbenv/versions/2.6.2/bin/ruby -I /Users/steve/.rbenv/versions/2.6.2/lib/ruby/2.6.0 -r ./siteconf20190506-31762-hxs46y.rb extconf.rb
checking if the C compiler accepts ... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
Installing nokogiri 1.10.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/steve/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/nokogiri-1.10.3/ext/nokogiri
/Users/steve/.rbenv/versions/2.6.2/bin/ruby -I /Users/steve/.rbenv/versions/2.6.2/lib/ruby/2.6.0 -r ./siteconf20190506-30612-1xpzioz.rb extconf.rb
checking if the C compiler accepts -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
@steveadams
steveadams / settings.json
Last active August 9, 2018 17:24
My Visual Studio Code settings
// Place your settings in this file to overwrite the default settings
{
"editor.cursorStyle": "line",
"editor.detectIndentation": true,
"editor.tabSize": 4,
"editor.fontSize": 15,
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,

Keybase proof

I hereby claim:

  • I am steveadams on github.
  • I am steveadams (https://keybase.io/steveadams) on keybase.
  • I have a public key ASDDigbjgjYkHbl4Iu7r94fXF7Yq2WHlkEsCId2XymEmJQo

To claim this, I am signing this object: