Skip to content

Instantly share code, notes, and snippets.

View hsorby's full-sized avatar

Hugh Sorby hsorby

  • University of Auckland
View GitHub Profile
@hsorby
hsorby / afshar.py
Created April 21, 2021 05:32
2021 CellML Workshop - libCellML Python scripts
import libcellml
p = libcellml.Parser()
with open('New_Modular_Model.cellml') as f:
contents = f.read()
m = p.parseModel(contents)
print(m.componentCount())
@hsorby
hsorby / encrypt.js
Last active February 25, 2021 23:12
Simple node script to encrypt a token for use with libCellML website.
// Instructions:
// Create a temporary directory and inside that directory install crypto-js.
// Then run the encrpyt.js script with node and pass your token as the first argument.
//
// Terminal commands:
// mkdir tmp
// cd tmp
// npm i crypto-js
// curl -o encrypt.js https://gist.githubusercontent.com/hsorby/4a091a16f9851044742a5de593ba974b/raw/587338203ce7b9dcc0baf0894f3d1d547a37a7a4/encrypt.js
// node encrypt.js <your-token>