Skip to content

Instantly share code, notes, and snippets.

View H6's full-sized avatar
🥥

H6 H6

🥥
View GitHub Profile
@H6
H6 / rails_admin.de.yml
Created December 18, 2014 09:08 — forked from soemo/rails_admin.de.yml
fix wrong translation in pagination
# German rails_admin translation
de:
admin:
home:
name: "Home"
pagination:
previous: "« Zurück"
next: "Vor »"
truncate: "…"
@H6
H6 / README.md
Last active August 29, 2015 14:15 — forked from jonathantneal/README.md

Local SSL websites on Mac OSX

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on Mac OSX Yosemite.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward edit to Sublime Text:

alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
@H6
H6 / gist:0a2df9130f26fd196406
Created July 3, 2015 10:07
NSData to NSString
+ (NSString*)base64forData:(NSData*)theData {
const uint8_t* input = (const uint8_t*)[theData bytes];
NSInteger length = [theData length];
static char table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
NSMutableData* data = [NSMutableData dataWithLength:((length + 2) / 3) * 4];
uint8_t* output = (uint8_t*)data.mutableBytes;
@H6
H6 / prevent broken ssh pipe
Created October 23, 2015 18:06
Prevent broken pipes with ssh
Add this to your .ssh/config
Host *
ServerAliveInterval 60
@H6
H6 / bash_profile
Last active December 12, 2015 15:41
Nice Color Bash Prompt with Github Branch and some aliases
# Clone to your home
# curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh -o ~/.git-prompt.sh
alias g='git'
alias h='history'
alias l='ls -G'
alias ll='ls -lhG'
alias lll='ls -lahG'
# Include in ~/.bash_profile:
@H6
H6 / tmux-sublime.sh
Last active July 12, 2018 08:51
Allow to open SublimeText from tmux on OS X
# if you don't have it install tmux
brew install tmux
# needed as a wrapper to handle subl -w in tmux
brew install reattach-to-user-namespace
# Create file ~/.tmux.conf
# Add the folo
echo "set-option -g default-command \"reattach-to-user-namespace -l bash\"" >> ~/.tmux.conf
@H6
H6 / WholeFile.java
Created January 7, 2016 17:26 — forked from sritchie/WholeFile.java
Hadoop input format for swallowing entire files.
package forma;
import forma.WholeFileInputFormat;
import cascading.scheme.Scheme;
import cascading.tap.Tap;
import cascading.tuple.Fields;
import cascading.tuple.Tuple;
import cascading.tuple.TupleEntry;
import java.io.IOException;
import org.apache.hadoop.mapred.JobConf;
@H6
H6 / .screenrc
Created February 9, 2016 20:32 — forked from nicerobot/.screenrc
.screenrc with "tabs" using hardstatus and caption options
# look and feel
caption always "%{= bb}%{+b w}%h %=%{=b rw} %l %{= db} ${USER}@%H %{= dg}%c"
hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"
# skip the startup message
startup_message off
# go to home dir
chdir
@H6
H6 / emr_bootstrap_java_8.sh
Created February 24, 2016 14:56 — forked from pstorch/emr_bootstrap_java_8.sh
Bootstrap script for installing Java 8 on an Amazon Elastic MapReduce instance (emr-4.0.0)
# Check java version
JAVA_VER=$(java -version 2>&1 | sed 's/java version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q')
if [ "$JAVA_VER" -lt 18 ]
then
# Figure out how many versions of Java and javac we currently have
NR_OF_JRE_OPTIONS=$(echo 0 | alternatives --config java 2>/dev/null | grep 'There ' | awk '{print $3}' | tail -1)
NR_OF_SDK_OPTIONS=$(echo 0 | alternatives --config javac 2>/dev/null | grep 'There ' | awk '{print $3}' | tail -1)
# Silent install javac (includes jre)
@H6
H6 / .profile
Created February 9, 2017 09:49 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else