These tests make assertions about some of the details regarding streams when they are connected to files and used within an async/await context. These details help me produce better error messages.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!nodem | |
// vim: set syntax=javascript : | |
foo // undefined, check reported line number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setDefaultBrowser(appFileName, notify) | |
local logger = hs.logger.new('defbr', 5) | |
local app = hs.application.open('com.apple.systempreferences') | |
local axapp = hs.axuielement.applicationElement(app) | |
-- Attempt to open the menu until it successfully opens (returns true) | |
hs.timer.waitUntil(function() | |
return app:selectMenuItem({'View', 'General'}) | |
end, function() | |
print('General group opened.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pullandextract() { | |
curl 'https://www.googleapis.com/storage/v1/b/broad-dmohs-public/o/test.tbz?alt=media' \ | |
| tar -xv | |
} | |
function tarandpush() { | |
tar -cy . | \ | |
curl 'https://www.googleapis.com/upload/storage/v1/b/broad-dmohs-public/o?uploadType=media&name=test.tbz' \ | |
--data-binary @- | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= Hiring Process | |
== Candidate Selection | |
=== Levels | |
For associate engineers, the candidate must have done something outside of schoolwork. This could be a personal project, a contribution to an open-source project, or an internship or other part-time work. | |
For software engineers, I expect proficiency in at least one language and one technology. For example, JavaScript and React, Java and Postgres, etc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= Engineering Philosophy | |
David Mohs <[email protected]> | |
:toc: macro | |
== My Core Principles | |
* Choose technologies where the creators share your engineering philosophy. | |
* Treat developer usability with the same reverence as product usability. | |
* Every choice has tradeoffs. If I have a good understanding of the benefits, but not the drawbacks, I'm making a poorly-informed choice. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[:div {:style {:backgroundColor "rgba(210, 210, 210, 0.4)" | |
:position "absolute" :top 0 :bottom 0 :right 0 :left 0 :zIndex 9999 | |
:display "flex" :justifyContent "center" :alignItems "center"}} | |
[:div {:style {:backgroundColor "#fff" :padding "2em"}} | |
[:span {:data-test-id "spinner" | |
:style {:margin "1em" :whiteSpace "nowrap" :display "inline-block"}} | |
[:span {:className "fa-spinner fa fa-pulse fa-fw" | |
:style {:marginRight "0.5rem"}}] | |
[:span {:data-test-id "spinner-text"} "Please wait..."]]]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http'); | |
const httpProxy = require('http-proxy'); | |
const proxy = new httpProxy.createProxyServer({ | |
target: { | |
host: 'notebook', | |
port: 8888 | |
} | |
}); | |
var proxyServer = http.createServer(function (req, res) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo = range(10) | |
foo.sort(key=lambda x: -x); print 'foo: '+str(foo) | |
# Suppose something isn't working. Let's try debugging this: | |
foo.sort(key=lambda x: print 'x: '+str(x); -x) # -> Syntax error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def do_i_suck_at_scoping(): | |
try: | |
import gc | |
y = [x for x in range(5)] | |
gc.collect() # Just to prove this isn't a garbage collection issue. | |
x # Should throw a NameError since it is undefined. | |
assert False, '''Sorry, I don't know how to properly scope variables.''' | |
except NameError: | |
pass |
NewerOlder