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 / 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
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 && \

Keybase proof

I hereby claim:

  • I am marks on github.
  • I am marksilverberg (https://keybase.io/marksilverberg) on keybase.
  • I have a public key whose fingerprint is F54F 3773 563C 8D5D A0DE 0EBF 5B8B CB60 347A 037E

To claim this, I am signing this object:

@marks
marks / test.sas
Last active October 18, 2016 21:35
/*
This SAS code file should output three files:
- sas_output.html (pretty HTML output)
- sas_output.lst (plain text ASCII output)
- sas.log (logs, not results)
*/
ods html file='/mnt/sas_output.html';
PROC PRINTTO LOG='/mnt/sas.log' PRINT='/mnt/sas_output.lst';