This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# install a powerful script with a special productivity advantage for mac users | |
( | |
cat <<-LAYERS | |
cat <<-OGRESARELIKELAYERS | |
,M, 7M= | |
= MMMM, M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#set -x | |
# Usage: shibb-cas-get.sh {username} {password} # If you have any errors try removing the redirects to get more information | |
# The service to be called, and a url-encoded version (the url encoding isn't perfect, if you're encoding complex stuff you may wish to replace with a different method) | |
DEST=https://myapp.example.com/ | |
SP=https://myapp.example.com/index.php | |
IDP="https://myidp.example.com/idp/shibboleth&btn_sso=SSOok" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# good for error-logging and mixing safe/unsafe execution | |
LOGFILE=/dev/stderr # default | |
log() { echo "$(date +'%D %H:%M:%S:') $*" >> "$LOGFILE"; } | |
die() { log "$*"; exit 111; } | |
try() { "$@" || die "Invalid: $*"; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# a buncha constants that come in handy while doin some calculations!!! | |
# just copy and paste this and run it in your ipython or julia interpreter, | |
# what are you worried about?? it's just a buncha constants, i didn't | |
# make em up, i'm just usin em!!!!! | |
alpha = 0.00729927 # fine structure constant | |
k = 1.38064852e-23 # boltzman constant (J/K) | |
keV = 8.6173324e-5 # boltzman constant (eV/K) | |
Na = 6.022140857e23 # avogadro constant (1/mol) | |
RgasJ = 8.3144598 # gas constant (J/(K mol)) | |
atm = 1.013e5 # 1 atmosphere (N/m^2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---- @sexpr: S-expression to AST conversion ---- | |
is_expr(ex, head::Symbol) = (isa(ex, Expr) && (ex.head == head)) | |
is_expr(ex, head::Symbol, n::Int) = is_expr(ex, head) && length(ex.args) == n | |
macro sexpr(ex) | |
esc(sexpr_to_expr(ex)) | |
end | |
sexpr_to_expr(ex) = expr(:quote, ex) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#------------------------------------------------------------------------------ | |
# bash script template by Stefan Countryman | |
# fill in the blanks as you go, crossing out todos as you finish them | |
# check your code for common mistakes with ShellCheck linter! | |
# browser-based: http://www.shellcheck.net/# | |
# install: https://github.com/koalaman/shellcheck#user-content-installing | |
# TODO: WRITE SCRIPT SUMMARY HERE | |
#------------------------------------------------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ "$#" -eq 1 ]; then stdinmsg=$(cat); fi | |
exec <"$0" || exit; read v; read v; read v; exec /usr/bin/osascript - "$@" "$stdinmsg"; exit | |
-- another way of waiting until an app is running | |
on waitUntilRunning(appname, delaytime) | |
repeat until my appIsRunning(appname) | |
tell application "Messages" to close window 1 | |
delay delaytime | |
end repeat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#------------------------------------------------------------------------------ | |
# HELP INFO | |
#------------------------------------------------------------------------------ | |
# | |
# example usage: make a new web site in a folder called "new_site" for someone | |
# named Rachel Bronstein: | |
# | |
# newblanksite new_site 'Rachel Bronstein' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# ligo stuff taken from https://wiki.ligo.org/DASWG/MacPorts and other sources | |
# run this as an admin but not as root. | |
# Use shellcheck for linting: http://www.shellcheck.net/# | |
set -o errexit | |
set -o nounset | |
set -o noclobber | |
cat <<NOTES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
sudo port install bash bash-completion | |
sudo port install vim | |
sudo port install git | |
sudo port install julia | |
sudo port install py27-jupyter |
OlderNewer