Skip to content

Instantly share code, notes, and snippets.

View marks's full-sized avatar

Mark Silverberg marks

View GitHub Profile
@marks
marks / 0-readme.md
Last active January 25, 2023 12:10
Airtable => Vestaboard integration
@marks
marks / 0-readme.md
Last active December 10, 2022 06:03
Update your @Vestaboard via command line

Down below is a quick script that lets you update your Vestaboard from the command line using curl and `jq

Try a rainbow:

bash vestaboard.sh " \
{63}{64}{65}{66}{67}{68} All \n \
{63}{64}{65}{66}{67}{68} You \n \
{63}{64}{65}{66}{67}{68} Need \n \
{63}{64}{65}{66}{67}{68} Is \n \
@marks
marks / grammar-alphanum.xml
Created February 10, 2010 19:14
Alpha-Numeric GRXML grammar by @skram
<?xml version= "1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar" xml:lang="en-US" root="TOPRULE">
<rule id="TOPRULE">
<tag>out.TOPRULE = "";</tag>
<item repeat="5-20">
<one-of>
<item><ruleref uri="#LETTERS"/><tag>out.SLOT = rules.LETTERS.SLOT1;</tag></item>
<item><ruleref uri="#NUMBERS"/><tag>out.SLOT = rules.NUMBERS.SLOT1;</tag></item>
</one-of>
<tag>out.TOPRULE = out.TOPRULE + out.SLOT;</tag>
@marks
marks / octave
Last active May 21, 2018 18:13
octave
#!/bin/sh -e
if command -v matlab >/dev/null 2>&1; then
if [ $# -gt 1 ]; then
# Remove ".m" script suffix if it exists, see http://www.mathworks.com/help/matlab/ref/matlablinux.html
COMMAND="${2%.m}"
matlab -nodisplay -nosplash -nodesktop -r "run $COMMAND; quit;"
else
echo "Error: Expecting argument 2 to contain the command to run in Matlab"
exit 1
(function(){
var uStatePaths=[
{id:"HI",n:"Hawaii",d:"M233.08751,519.30948L235.02744,515.75293L237.2907,515.42961L237.61402,516.23791L235.51242,519.30948L233.08751,519.30948ZM243.27217,515.59127L249.4153,518.17784L251.51689,517.85452L253.1335,513.97465L252.48686,510.57977L248.28366,510.09479L244.24213,511.87306L243.27217,515.59127ZM273.9878,525.61427L277.706,531.11074L280.13092,530.78742L281.26255,530.30244L282.7175,531.59573L286.43571,531.43407L287.40568,529.97912L284.49577,528.20085L282.55584,524.48263L280.45424,520.92609L274.63444,523.83599L273.9878,525.61427ZM294.19545,534.50564L295.48874,532.5657L300.17691,533.53566L300.82356,533.05068L306.96668,533.69732L306.64336,534.99062L304.05678,536.44556L299.69193,536.12224L294.19545,534.50564ZM299.53027,539.67879L301.47021,543.55866L304.54176,542.42703L304.86509,540.81041L303.24848,538.70882L299.53027,538.3855L299.53027,539.67879ZM306.4817,538.54716L308.74496,535.63726L313.43313,538.06218L317.79798,539.19381L322.16284,541.94205L322.16284,543.88198L318.6063,545.6
RUN \
yum install -y gmp-devel latex2rtf
# Install relatively up-to-date Haskell and Cabal
RUN \
mkdir -p /tmp/tex && \
cd /tmp/tex && \
wget http://www.haskell.org/ghc/dist/7.8.2/ghc-7.8.2-x86_64-unknown-linux-centos65.tar.bz2 && \
tar xf ghc-7.8.2-x86_64-unknown-linux-centos65.tar.bz2 && \
alwaysSaveHistory="1"
cleanTexi2DviOutput="1"
cleanupAfterRCmdCheck="1"
contextIdentifier="26321B8F"
cranMirrorCountry="us"
cranMirrorHost="RStudio"
cranMirrorName="Global (CDN)"
cranMirrorUrl="http://cran.rstudio.com/"
enableLaTeXShellEscape="0"
errorHandlerType="3"
### Method 1-A
mkdir -p /home/domino/.rstudio/monitored/user-settings/
echo 'uiPrefs={"theme" : "Mono Industrial"}' >> /home/domino/.rstudio/monitored/user-settings/user-settings
chown -R domino:domino /home/domino/.rstudio
if [ -f .domino/launch-rstudio-server ]; then
sed -i.bak 's# > ~/.rstudio/monitored/user-settings/user-settings# >> ~/.rstudio/monitored/user-settings/user-settings#' .domino/launch-rstudio-server
chown domino:domino .domino/launch-rstudio-server
fi
### Method 2 - snippet 1
from theano import function, config, shared, sandbox
import theano.tensor as T
import numpy
import time
vlen = 10 * 30 * 768 # 10 x #cores x # threads per core
iters = 1000
rng = numpy.random.RandomState(22)
x = shared(numpy.asarray(rng.rand(vlen), config.floatX))
RUN \
export CUDA_HOME=/usr/local/cuda-7.5 && \
export CUDA_ROOT="/usr/local/cuda-7.5/bin" && \
export PATH=/usr/local/cuda-7.5/bin:$PATH && \
export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64 && \
cd ~ && \
wget https://app.dominodatalab.com/johnjoo/cuDNN_for_TF/raw/latest/cudnn-7.5-linux-x64-v5.1.tgz -O cudnn-7.5-linux-x64-v5.1.tgz.gz && \
gunzip cudnn-7.5-linux-x64-v5.1.tgz.gz && \
tar xvzf cudnn-7.5-linux-x64-v5.1.tgz && \
cp cuda/include/cudnn.h /usr/local/cuda-7.5/include && \