Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env zsh
BREW_HOME="$(brew --prefix)"
if [[ -d $BREW_HOME/opt/grep/libexec/gnubin ]]; then
export PATH="$BREW_HOME/opt/grep/libexec/gnubin:$PATH"
fi
if [[ -d $BREW_HOME/opt/gnu-sed/libexec/gnubin ]]; then
export PATH="$BREW_HOME/opt/gnu-sed/libexec/gnubin:$PATH"

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

#!/usr/bin/env zsh
# ------------------------------------------------------------------------------
# Prompt for the Zsh shell:
# * One line.
# * VCS info on the right prompt.
# * Only shows the path on the left prompt by default.
# * Crops the path to a defined length and only shows the path relative to
# the current VCS repository root.
# * Wears a different color wether the last command succeeded/failed.
# * Shows user@hostname if connected through SSH.
@phyrog
phyrog / sequel_dot
Last active December 12, 2017 16:57 — forked from ericgj/sequel_dot.rb
ER diagrams with Sequel and Graphviz
#!/usr/bin/env ruby
#
# Usage:
# sequel_dot [SEQUEL-DATABASE-URI] > output.dot
# Or pipe directly to Graphviz:
# sequel_dot [SEQUEL-DATABASE-URI] | dot -Tgif > output.gif
#
# Note adapted from Jeremy Evans' and Rohit Namjoshi's son's code at
# http://sequel.heroku.com/2010/05/29/fun-with-graphviz-and-associations/
#
@phyrog
phyrog / pdfdecrease
Last active December 8, 2017 15:31
Decreases the pdf's size by decreasing the quality
#!/bin/sh
fout=${1%.*}
out="$fout.small.pdf"
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=$out $1
@phyrog
phyrog / qr
Last active November 17, 2017 09:40
#!/bin/sh
printf $1 | curl -F-=\<- qrenco.de
@phyrog
phyrog / dev
Last active October 27, 2017 17:27
#!/usr/bin/zsh
_dev() {
local -a dir
dir="$DEV"
_arguments '-p[Use playground]:playground:->playground' '--play[Use playground]:playground:->playground' '-n[New directory]:new' '--new[New directory]:new'
case "$state" in
playground)
dir="$PLAYGROUND"
esac
@phyrog
phyrog / Rakefile.rb
Last active February 10, 2016 16:16
Generator for chicken scheme documentation
require "rake"
require "tmpdir"
require "fileutils"
require "nokogiri"
require "pathname"
require "base64"
tmpdir = Dir.mktmpdir
setdir = "#{tmpdir}/chicken.docset"
condir = "#{setdir}/Contents"
@phyrog
phyrog / PKGBUILD
Created December 16, 2014 12:45
with-readline PKGBUILD script
pkgname=with-readline
pkgver=0.1.1
pkgrel=1
pkgdesc="with-readline is a small program that allows the GNU Readline library to be used with arbitrary programs, without having to recompile those programs"
arch=('i686' 'x86_64')
url="http://www.greenend.org.uk/rjk/sw/withreadline.html"
license=('GPL')
depends=('readline>=6.0.0')
source=("http://www.greenend.org.uk/rjk/sw/with-readline-$pkgver.tar.gz")
sha1sums=('ac32f4b23853024f2a42441fa09b20cbe7617ff5')