Skip to content

Instantly share code, notes, and snippets.

Adam Wespiser adamwespiser

Block or report user

Report or block adamwespiser

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View freshfox_macos
#!/bin/sh -e
alias firefox=/Applications/Firefox.app/Contents/MacOS/firefox
DIR="${XDG_CACHE_HOME:-$HOME/.cache}"
mkdir -p -- "$DIR"
TEMP="$(mktemp -d -- "$DIR/firefox-XXXXXX")"
trap "rm -rf -- '$TEMP'" INT TERM EXIT
firefox -profile "$TEMP" -no-remote "$@"
View conf intervals for point-wise prediction
#https://stats.stackexchange.com/questions/29044/plotting-confidence-intervals-for-the-predicted-probabilities-from-a-logistic-re
library(tidyverse)
library(magrittr)
set.seed(1234)
# create fake data on gambling. Does prob win depend on bid size?
mydat <- data.frame(
@adamwespiser
adamwespiser / theme_publish.R
Created Jul 9, 2012
ggplot2 publication theme
View theme_publish.R
# execute the following code to create a theme_publish object
# for example, ggplot(mtcars,aes(mpg,hp,size=wt))+geom_point()+theme_publish()
# note: for discrete colored data, use gray scale:
# > palette(gray(0:3 / 3))
# > greys <- palette()
@adamwespiser
adamwespiser / free-mtl-notes
Last active Feb 4, 2018
A comparison of performance between Free Monad and mtl transformers
View free-mtl-notes
Objective: A comparison of performance between Free Monad and mtl transformers
```Haskell
Free f a = { unFree :: f (Free f a) }
```
http://softwareengineering.stackexchange.com/questions/242795/what-is-the-free-monad-interpreter-pattern
# construction of free monad via individual functions
http://www.atamo.com/articles/free-monads-wont-detox-your-colon/
@adamwespiser
adamwespiser / log-reg-posterior.R
Created Jan 31, 2018
Bayesian Log Reg: What is the difference between the expected pr(y==1| model) and pr(pr==1| model)[calc w/ expectation of beta] ?
View log-reg-posterior.R
library(rstan)
library(dplyr)
options(mc.cores = parallel::detectCores())
rstan_options(auto_write = TRUE)
seed_sim = 1234
set.seed(seed_sim)
# set up data
N = 4000
@adamwespiser
adamwespiser / first_script.sh
Last active Jul 1, 2017
Ubuntu command line into
View first_script.sh
#!/bin/bash
echo "current dir"
ls ./
echo
echo "Root directory"
ls /
View keybase.md

Keybase proof

I hereby claim:

  • I am adamwespiser on github.
  • I am adamwespiser (https://keybase.io/adamwespiser) on keybase.
  • I have a public key ASDvVfiszzMDEZN4nTBPDJakWg9yqyuwpGloZCblP3xQigo

To claim this, I am signing this object:

@adamwespiser
adamwespiser / bwt_unOptimized
Last active Jan 8, 2016
Burrows Wheeler Tranformation
View bwt_unOptimized
(ns bwt.lib)
(defn pTest [ys]
(sort-by #(second %) (map vector (range) ys)))
(defn p [ys]
(map second (sort-by #(first %)
(map list ys (range)))))
(defn recon[s index]
(let [l (vec (map first (sort-by #(second %) (map conj (bwt.lib/pTest s)(range)))))
@adamwespiser
adamwespiser / postgresQuick.sql
Last active Jan 5, 2016
A quick list of DBA commands for postgresql
View postgresQuick.sql
-- http://pentestmonkey.net/cheat-sheet/sql-injection/postgres-sql-injection-cheat-sheet
-- show tables
select * from pg_tables;
-- get all the active connections/tasks
select * from pg_stat_activity;
-- get sizes of active databases
\l+
You can’t perform that action at this time.