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
function fib(n::Integer) | |
@assert n ≥ 0 | |
if iszero(n) | |
return zero(n) | |
elseif n == 1 || n == 2 | |
return one(n) | |
end | |
k = div(n,2) | |
if iseven(n) | |
return fib(k) * (2fib(k+1) - fib(k)) |
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 tensor of zeros" | |
struct ZeroTensor{T <: Number, N} <: AbstractArray{T,N} | |
dims::NTuple{N,Int} | |
function ZeroTensor{T,N}(dims::Vararg{Integer,N}) where {T <: Number, N} | |
all(dims .≥ 0) || error("invalid ZeroTensor dimensions") | |
new(dims) | |
end | |
end | |
ZeroTensor(T::DataType, dims::Vararg{Integer,N}) where N = ZeroTensor{T,N}(dims...) | |
ZeroTensor(dims::Vararg{Integer,N}) where {N} = ZeroTensor{Float64,N}(dims...) |
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
pdfimages -j input.pdf output |
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
ENV["JULIA_EDITOR"] = "vim -R" |
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 zsh | |
submodules=("${(@f)$(find . -type d -depth 1)}") | |
for submodule in $submodules | |
do | |
print "=== $submodule" | |
git --work-tree=$submodule --git-dir=$submodule/.git $* | |
done |
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
Pkg.clone("https://github.com/cossio/Utils.jl") | |
Pkg.clone("https://github.com/cossio/COBRAUtils.jl") | |
Pkg.clone("https://github.com/cossio/TruncatedNormal.jl") |
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 | |
git push origin master |
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
rsync -avzP source destination |
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
/** | |
* The onOpen function runs automatically when the Google Docs document is | |
* opened. Use it to add custom menus to Google Docs that allow the user to run | |
* custom scripts. For more information, please consult the following two | |
* resources. | |
* | |
* Extending Google Docs developer guide: | |
* https://developers.google.com/apps-script/guides/docs | |
* | |
* Document service reference documentation: |
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 | |
# $Id: pdf2eps,v 0.01 2005/10/28 00:55:46 Herbert Voss Exp $ | |
# Convert PDF to encapsulated PostScript. | |
# usage: | |
# pdf2eps <page number> <pdf file without ext> | |
pdfcrop $2.pdf | |
pdftops -f $1 -l $1 -eps "$2-crop.pdf" | |
rm "$2-crop.pdf" | |
mv "$2-crop.eps" $2.eps |