Skip to content

Instantly share code, notes, and snippets.

View herrphon's full-sized avatar

Alexander von Renteln herrphon

View GitHub Profile
@herrphon
herrphon / Raphael-JS.markdown
Created May 1, 2014 10:50
A Pen by Herr Phon.
@herrphon
herrphon / Raphael-JS.markdown
Created May 2, 2014 17:35
A Pen by Herr Phon.

Keybase proof

I hereby claim:

  • I am herrphon on github.
  • I am herrphon (https://keybase.io/herrphon) on keybase.
  • I have a public key whose fingerprint is 5463 5C04 EEB0 EAB5 AE06 48F8 E2D7 327C FFB8 58BE

To claim this, I am signing this object:

@herrphon
herrphon / .screenrc
Created December 19, 2014 14:57
~/.screenrc
hardstatus alwayslastline '[%{b}%d.%m.%Y - %c%{-}] [%{r}%n:%t%{-} | %W] [%{g}%l%{-}] [%{b}%h%{-}] '
defutf8 on
@herrphon
herrphon / gist:8bd295bac47ae4f5278f
Created December 19, 2014 15:38
Disc Usage Monitoring
WARN:
df -h | grep "[7,8][0-9]% /"
ERROR:
df -h | grep "[9,0][0-9]% /"
@herrphon
herrphon / gist:bf62bf79603ed3154494
Created December 30, 2014 13:33
ruby - proc, block, yield - capture stdin/out
require 'stringio'
require 'pp'
def capture_all(proc)
begin
$stdout = StringIO.new
$stderr = StringIO.new
proc.call
@herrphon
herrphon / capture_io_spec.rb
Last active April 20, 2023 04:07
ruby rspec capture I/O stdout/stderr
require 'pp'
module Helper
def capture(&block)
begin
$stdout = StringIO.new
$stderr = StringIO.new
yield
result = {}
result[:stdout] = $stdout.string
package de.aeffle.for_each_with_counter;
import com.google.common.collect.ImmutableList;
import org.junit.Test;
import java.util.Iterator;
import java.util.List;
public class ForEachLoopWithIndex {
@herrphon
herrphon / convert id_rsa to pem
Created May 6, 2017 08:08 — forked from mingfang/convert id_rsa to pem
Convert id_rsa to pem file
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
chmod 700 id_rsa.pem
@herrphon
herrphon / brew-java-and-jenv.md
Created June 11, 2017 20:32 — forked from tjsoftworks/brew-java-and-jenv.md
How To Install Java 8 on Mac

Install HomeBrew first

brew update
brew tap caskroom/cask
brew install brew-cask

If you get the error "already installed", follow the instructions to unlink it, then install again: