Skip to content

Instantly share code, notes, and snippets.

@ggarza
ggarza / Makefile
Last active July 17, 2018 13:20
A Makefile for Knitr
# Makefile for knitr
# optionally put all RNW files to be compiled to pdf here, separated by spaces
RNW_FILES= $(wildcard *.Rnw)
# location of Rscript
R_HOME?=/Library/Frameworks/R.framework/Resources
# these pdf's will be compiled from Rnw and Rmd files
PDFS= $(RNW_FILES:.Rnw=.pdf)
@ggarza
ggarza / octave
Created December 29, 2013 19:45
Installing Octave from Homebrew
This file has been truncated, but you can view the full file.
/usr/bin/curl -f#LA Homebrew 0.9.5 (Ruby 1.8.7-358; Mac OS X 10.9.1) https://github.com/ambs/homebrew-science/raw/bbfa870474232ffbb9468a1d659d311f061b3a26/octave.rb -o /Library/Caches/Homebrew/Formula/octave.rb --silent
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> Building with an alternative Fortran compiler
This is unsupported.
==> Building with an alternative Fortran compiler
This is unsupported.
==> Downloading http://ftpmirror.gnu.org/octave/octave-3.8.0.tar.bz2
Already downloaded: /Library/Caches/Homebrew/octave-3.8.0.tar.bz2
==> Verifying octave-3.8.0.tar.bz2 checksum
@ggarza
ggarza / julia_verbose
Created August 8, 2013 01:43
Output from HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install --HEAD julia 2>&1 | tee ~/julia_verbose
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> Cloning https://github.com/JuliaLang/julia.git
git --git-dir /Library/Caches/Homebrew/julia--git/.git status -s
Updating /Library/Caches/Homebrew/julia--git
git config remote.origin.url https://github.com/JuliaLang/julia.git
git config remote.origin.fetch +refs/heads/master:refs/remotes/origin/master
git fetch origin
git checkout -f master
Already on 'master'
@ggarza
ggarza / octave_verbose
Created April 15, 2013 19:36
Output from `HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install octave 2>&1 | tee ~/octave_verbose` after uninstalling and reinstalling suite-sparse
==> Downloading http://ftpmirror.gnu.org/octave/octave-3.6.4.tar.bz2
Already downloaded: /Library/Caches/Homebrew/octave-3.6.4.tar.bz2
tar xf /Library/Caches/Homebrew/octave-3.6.4.tar.bz2
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/octave/3.6.4 --with-blas=-Wl,-framework -Wl,Accelerate --with-umfpack=-lumfpack -lsuitesparseconfig --without-framework-carbon
./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/octave/3.6.4 --with-blas=-Wl,-framework -Wl,Accelerate --with-umfpack=-lumfpack -lsuitesparseconfig --without-framework-carbon
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
@ggarza
ggarza / gist:5389739
Created April 15, 2013 17:22
Output from 'HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install octave'
==> Downloading http://ftpmirror.gnu.org/octave/octave-3.6.4.tar.bz2
Already downloaded: /Library/Caches/Homebrew/octave-3.6.4.tar.bz2
tar xf /Library/Caches/Homebrew/octave-3.6.4.tar.bz2
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/octave/3.6.4 --with-blas=-Wl,-framework -Wl,Accelerate --with-umfpack=-lumfpack -lsuitesparseconfig --without-framework-carbon
./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/octave/3.6.4 --with-blas=-Wl,-framework -Wl,Accelerate --with-umfpack=-lumfpack -lsuitesparseconfig --without-framework-carbon
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
@ggarza
ggarza / pareto.R
Created December 11, 2012 21:43
An R script that creates a pareto diagram.
# tikz("./figures/pareto.tikz", width=6.0, height=3.50)
defects <- c(56, 45, 23, 12, 8, 6)
names(defects) <- c("Blem.", 'Scratch', 'Chip', 'Bend', 'Dent',
'Others')
defects_sort <- sort(defects, decreasing=TRUE)
# par(mar = c(5, 4, 4, 4) + 0.3)
par(mar = c(5, 4, 3, 4) + 0.3)
bp <- barplot(defects,
# panel.first=grid(ny=NULL, nx=NA, lty="dashed", col="black"),
ylim=c(0, sum(defects)* 1.05),
@ggarza
ggarza / vcsupdate
Created August 7, 2015 02:03
Small python script to update vcs repos
#!/usr/bin/env python
#from http://djangosnippets.org/snippets/844/
import os
import os.path
from subprocess import call
if __name__ == "__main__":
apps_dir = os.path.abspath('.')
for app_name in os.listdir(apps_dir):
" Vim filetype plugin file
" Language: julia
autocmd! BufLeave,FocusLost * nested silent! update
nmap <buffer> <silent> <space> <esc>:call Send_to_iterm()<cr>j
noremap <leader>ae <esc>:w<cr>:call Send_input_file_to_iterm()<cr>
noremap <leader>rf <esc>:w<cr>:call New_julia_repl()<cr>
noremap <leader>pd <esc>:w<cr>:call Get_paragraph()<cr>
@ggarza
ggarza / brew_config
Created April 3, 2014 01:15
openblas-julia and julia build logs
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: 88f0fdf62804017c5d747fb9f5ed708f484f573b
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit ivybridge
OS X: 10.9.2-x86_64
Xcode: 5.1
CLT: 5.1.0.0.1.1393561416
Clang: 5.1 build 503
@ggarza
ggarza / Makefiles.diff
Created April 2, 2014 22:02
Patch for Homebrew Julia
diff --git c/Makefile w/Makefile
index edfe244..277025e 100644
--- c/Makefile
+++ w/Makefile
@@ -99,7 +99,7 @@ $(build_bindir)/stringpatch: $(build_bindir) contrib/stringpatch.c
JL_LIBS = julia julia-debug
# private libraries, that are installed in $(prefix)/lib/julia
-JL_PRIVATE_LIBS = random suitesparse_wrapper grisu
+JL_PRIVATE_LIBS = random suitesparse_wrapper grisu Rmath