Skip to content

Instantly share code, notes, and snippets.

View poolik's full-sized avatar

Tõnis Pool poolik

View GitHub Profile

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
#connect-container {
float: left;
width: 400px
}
#connect-container div {
padding: 5px;
@poolik
poolik / better_functions.sh
Created February 16, 2014 08:54
Notifications from terminal
function notifyDone () { command="$@"; terminal-notifier -title "Terminal" -message "Done with '$command'!" -activate com.googlecode.iterm2; }
function notifyError () { command="$@"; terminal-notifier -title "Terminal ERROR!" -message "'$command' exited with error!" -activate com.googlecode.iterm2; }
function wn () { ($@ && notifyDone $@) || notifyError $@; }
function n () { $@; notifyDone $@;}
# Usage:
# if command returns 0 on success and non 0 on error:
wn git push heroku production:master
# else
n git push heroku production:master
@poolik
poolik / ArquillianUtils.java
Last active August 23, 2018 15:11
Example of how to use parameterized tests with Arquillian. Supports running arquillian tests both "in client" or "in container". For more information see: http://poolik.com/2014/02/how-to-run-parameterized-junit-arquillian-tests/
public class ArquillianUtils {
public static boolean isRunningInContainer() {
try {
new InitialContext().lookup("java:comp/env");
return true;
} catch (NamingException e) {
return false;
}
}
#!/usr/bin/python
import multiprocessing as mp
import memcache, os, time, uuid
WORKERS = 20
WORK_ATTEMPTS = 20
total_doc_list = []
#!/usr/bin/python
import multiprocessing as mp
import redis, os, time, uuid
WORKERS = 20
WORK_ATTEMPTS = 20
total_doc_list = []
#!/usr/bin/python
import multiprocessing as mp
import riak, os, time, uuid
DB = "perf_test"
WORKERS = 20
WORK_ATTEMPTS = 20
#!/usr/bin/python
import multiprocessing as mp
import couchdb, os, time, uuid
URL = "http://localhost:5984"
DB = "perf_test"
WORKERS = 20
WORK_ATTEMPTS = 20