Skip to content

Instantly share code, notes, and snippets.

-nosplash
--launcher.defaultAction
openFile
-vm
C:/JDK7/jre/bin/server/jvm.dll #Windows
#/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/java #OS X
-vmargs
-Xincgc
-Xss1m
-Duser.name=FirstName LastName
# http://stackoverflow.com/a/7819465/720077
takeover() {
# create a temporary session that displays the "how to go back" message
tmp='takeover temp session'
if ! tmux has-session -t "$tmp"; then
tmux new-session -d -s "$tmp"
tmux set-option -t "$tmp" set-remain-on-exit on
tmux new-window -kt "$tmp":0 \
'echo "Use Prefix + L (i.e. ^B L) to return to session."'
vows = require 'vows'
zombie = require 'zombie'
assert = require 'assert'
events = require 'events'
promise = require 'promise'
zombie.synchronousChain = (browser, steps)->
promise = new(events.EventEmitter)
zombie._linkInTheChain(promise, browser, steps)
promise
public class RetrierTest {
private static int count = 0;
@Rule public RetryRule rule = new RetryRule();
@Test
@Retry
public void failsFirst() throws Exception {
count++;
assertEquals(2, count);
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
@sirkkalap
sirkkalap / itunes_filter_new_media.sh
Last active August 29, 2015 14:21 — forked from mattlubner/ itunes_filter_new_media.sh
Untested, there were issues with Automator service on Yosemite and iTunes 12.1.2.27 (Locale: fi_fi)
#!/bin/bash
permitted_file_extensions="mov|mp4|m4v|mpg|mpeg|m2v|mp2|ite|aac|m4a|m4b|m4p|mp3|caf|aiff|aif|aifc|au|sd2|wav|snd|amr|3ga"
eval "active_library="$(defaults read com.apple.iApps iTunesRecentDatabases)
printf -v active_library '%b' "${active_library[0]//%/\\x}"
active_library="${active_library#file://}"
if [[ ! -e "$active_library" ]]; then
exit 1
fi
@sirkkalap
sirkkalap / ssh-agent.sh
Last active October 8, 2015 14:49 — forked from mattbailey/ssh-agent.sh
ssh-agent
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add >/dev/null
/usr/bin/ssh-add $HOME/.ssh/id_rsa
}
@sirkkalap
sirkkalap / ssh-agent-init.sh
Last active October 8, 2015 16:04 — forked from im007boy/gist:4079756
ssh-agent
## from https://gist.github.com/sirkkalap/5b1ac4c3619232533dcc
SSHAGENT=/usr/bin/ssh-agent
SSHAGENTARGS="-s"
eval `$SSHAGENT $SSHAGENTARGS`
trap "kill $SSH_AGENT_PID" 0
ids=$(echo $HOME/.ssh/id* | sed -E "s/ ?[^ ]+\.pub//g")
for id in $ids; do
ssh-add $id
done
ssh-add -l
@sirkkalap
sirkkalap / vim_centos.sh
Last active March 11, 2017 17:00 — forked from fundon/vim_centos.sh
install vim 7.3 on centos, debian, arch etc.
#!/bin/bash
# Install VIM with LUA support on centos minimal (tested 2016-01-21 on CentOS 7)
# source <(curl -sSL https://gist.githubusercontent.com/sirkkalap/1a9d954122039ab6f78f/raw/vim_centos.sh)
# bailout on errors
set -e
sudo yum -y groupinstall 'Development tools'
sudo yum -y install ncurses-devel
sudo yum -y install python python-devel