Skip to content

Instantly share code, notes, and snippets.

from pyvirtualdisplay import Display
xephyr=Display(visible=1, size=(320, 240)).start()
from easyprocess import EasyProcess
from pyvirtualdisplay.smartdisplay import SmartDisplay
with SmartDisplay(visible=0, bgcolor='black') as disp:
with EasyProcess('gxmessage hello'):
img = disp.waitgrab()
img.save('screenshot.png')
@slarson
slarson / 3d-cubes-depth-of-field-shader.markdown
Created January 9, 2017 01:37
3D Cubes - Depth of Field Shader
@slarson
slarson / 3d-cubes-study-2-blur.markdown
Last active January 8, 2017 23:41
3D Cubes Study 2 - blur
@slarson
slarson / openworm repos
Last active October 2, 2016 20:38
Most popular OpenWorm github repositories to follow
https://github.com/openworm/OpenWorm,
https://github.com/openworm/org.geppetto,
https://github.com/openworm/PyOpenWorm,
https://github.com/openworm/open-worm-analysis-toolbox,
https://github.com/openworm/sibernetic,
https://github.com/openworm/CElegansNeuroML,
https://github.com/openworm/muscle_model,
https://github.com/openworm/ChannelWorm,
https://github.com/openworm/openworm_docs
pyNeuroML >>> jNeuroML >> (INFO) NRN Output >>> first instance of n_SMBDR
pyNeuroML >>> jNeuroML >> (INFO) NRN Output >>> Population SMBVL contains 1 instance(s) of component: GenericCell of type: cell
pyNeuroML >>> jNeuroML >> (INFO) NRN Output >>> Setting the default initial concentrations for ca (used in GenericCell) to 0.0 mM (internal), 2.0 mM (external)
pyNeuroML >>> jNeuroML >> (INFO) NRN Output >>> first instance of n_SMBVL
pyNeuroML >>> jNeuroML >> (INFO) NRN Output >>> Population SMBVR contains 1 instance(s) of component: GenericCell of type: cell
pyNeuroML >>> jNeuroML >> (INFO) NRN Output >>> Setting the default initial concentrations for ca (used in GenericCell) to 0.0 mM (internal), 2.0 mM (external)
pyNeuroML >>> jNeuroML >> (INFO) NRN Output >>> first instance of n_SMBVR
pyNeuroML >>> jNeuroML >> (INFO) NRN Output >>> Population SMDDL contains 1 instance(s) of component: GenericCell of type: cell
pyNeuroML >>> jNeuroML >> (INFO) NRN Output >>> Setting the default ini
@slarson
slarson / Graphs and 3D plots.ipynb
Created February 1, 2016 08:07
pca over time series, graphs, 3d plots
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@slarson
slarson / gist:468342225bf0d685a383
Created January 5, 2016 04:33
Sibernetic build error -- development branch -- january 4th 2016
root@2215ccdc7418:/sibernetic# make all
Building file: src/PyramidalSimulation.cpp
Invoking: GCC C++ Compiler
g++ -I/usr/include/python2.7 -Iinc -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Release/obj/PyramidalSimulation.d" -MT"Release/obj/PyramidalSimulation.d" -o "Release/obj/PyramidalSimulation.o" "src/PyramidalSimulation.cpp"
Finished building: src/PyramidalSimulation.cpp
Building file: src/main.cpp
Invoking: GCC C++ Compiler
g++ -I/usr/include/python2.7 -Iinc -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Release/obj/main.d" -MT"Release/obj/main.d" -o "Release/obj/main.o" "src/main.cpp"
src/main.cpp: In function 'int main(int, char**)':
@slarson
slarson / gist:66afd1351bf52b2c2b8d
Last active July 28, 2017 00:04
Running GUIs via Docker on Yosemite OSX
As [here](http://kartoza.com/how-to-run-a-linux-gui-application-on-osx-using-docker/)
brew install socat
brew cask install xquartz
open -a XQuartz
xhost +
socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"
# in another window
# run ifconfig and inspect the output. Look for an "inet" address within a "vboxnet" section. this is your IP
from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
@slarson
slarson / Hodgkin Huxley.py
Created December 6, 2014 19:53
Hodgkin Huxley Python Implementation
import scipy as sp
import pylab as plt
from scipy.integrate import odeint
from scipy import stats
import scipy.linalg as lin
## Full Hodgkin-Huxley Model (copied from Computational Lab 2)
# Constants
C_m = 1.0 # membrane capacitance, in uF/cm^2