Skip to content

Instantly share code, notes, and snippets.

Avatar

Hugh Sorby hsorby

  • University of Auckland
View GitHub Profile
@hsorby
hsorby / afshar.py
Created Apr 21, 2021
2021 CellML Workshop - libCellML Python scripts
View afshar.py
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 Feb 25, 2021
Simple node script to encrypt a token for use with libCellML website.
View encrypt.js
// 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>