Skip to content

Instantly share code, notes, and snippets.

View jason-curtis's full-sized avatar

Jason Curtis jason-curtis

View GitHub Profile
@jason-curtis
jason-curtis / gist:746affa2385639c8fd2ea3c0332c70e3
Created August 17, 2023 03:44
Failure to install mermaid on fresh github spaces instance
@jason-curtis ➜ /workspaces/mermaid (issue-2509-subgraph-direction-limitation) $ volta install node
success: installed and set [email protected] (with [email protected]) as default
note: you are using [email protected] in the current project
@jason-curtis ➜ /workspaces/mermaid (issue-2509-subgraph-direction-limitation) $ npx pnpm install
Need to install the following packages:
[email protected]
Ok to proceed? (y)
Scope: all 6 workspace projects
Lockfile is up to date, resolution step is skipped
Packages: +1985
@jason-curtis
jason-curtis / resstock failure message.log
Created February 22, 2023 21:04
resstock failure message
failed with Measure HPXMLtoOpenStudio reported an error with ["
No such file or directory @ apply2files -
/var/folders/yw/spnh9nss2bxgjmd20y7m3x2c0000gn/T/xmlvalidation-1676945373-0
:/ruby/2.7.0/fileutils.rb:1466:in `unlink'
:/ruby/2.7.0/fileutils.rb:1466:in `block in remove_file'
:/ruby/2.7.0/fileutils.rb:1471:in `platform_support'
:/ruby/2.7.0/fileutils.rb:1465:in `remove_file'
:/ruby/2.7.0/fileutils.rb:1454:in `remove'
:/ruby/2.7.0/fileutils.rb:780:in `block in remove_entry'
:/ruby/2.7.0/fileutils.rb:1509:in `postorder_traverse'
@jason-curtis
jason-curtis / plotly-coronavirus-exploration.ipynb
Last active March 27, 2020 16:37
Plotly coronavirus exploration.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import heapq
# you have to create the list yourself
heap = [some list]
# heapq will modify your list in place!
# Organize the heap as a heap.
# Worst case time complexity: O(n log(n))
# Average time complexity: O(1)
@jason-curtis
jason-curtis / hypothesis_example.py
Created January 21, 2020 23:22
Simple example of how to use hypothesis library
import hypothesis
@hypotheis.given(hypothesis.strategies.text())
def test_my_function_returns_string_input(s):
assert my_function(s) == s
# Tests your “hypothesis” with a whole bunch of different types of garbage.
my_function()
@jason-curtis
jason-curtis / bisect_example.py
Created January 21, 2020 23:21
bisect example
import bisect
def value_is_present(list_, value):
insertion_point = bisect.bisect_left(list_, value)
return (
# If value is larger than all values in list_, it will be len(list_)
insertion_point < len(list_)
and arr[insertion_point] == value
)

These are standards that we came up with at Osmo Systems to allow technicians to use Jupyter notebooks to run experiments, while maintaining quality standards to avoid bugs and promote readability and reusability.

Each experiment we did was saved in a shared Google Drive folder, which contained a README entry point and any supporting notebooks and other files.

Standard Notebook Practices

  • In general, see Code Style Manifesto
  • Write code conforming to Pep8, e.g. imports, top-level constants
  • Black code formatting is preferred. You can add a black formatting button to your notebook with this tool.
  • Self-documentation: Someone else (or yourself in 3 months) should be able to open the notebook and know wtf is going on and why. Note: your README is the standard entry point for understanding the experiment at a high level (so that you don’t need jupyter to understand the purpose and basi
@jason-curtis
jason-curtis / roman_test.py
Last active June 20, 2018 21:21 — forked from vralex/roman_test.py
Dive into python 3 example. Unit testing.
__author__ = 'VladimirDel'
import roman
import unittest
class KnownValues(unittest.TestCase):
known_values = ( (1, 'I'),
(2, 'II'),
(3, 'III'),
extends:
- eslint-config-airbnb
- plugin:import/errors
- plugin:import/warnings
parser:
babel-eslint
settings:
ecmascript: 6