Skip to content

Instantly share code, notes, and snippets.

Duana Saskia starkcoffee

Block or report user

Report or block starkcoffee

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .vimrc
execute pathogen#infect()
syntax on
filetype plugin indent on
filetype indent on
set autoindent
set nosmartindent
set smarttab
set shiftwidth=2
set tabstop=2
set softtabstop=2
starkcoffee / .sh
Created Aug 10, 2016
Safe git YOLO
View .sh
alias yolo='(git symbolic-ref HEAD | grep -vq master && cowthink -f stegosaurus "#YOLO" && git push --force-with-lease) || cowthink -f beavis.zen "You tried to push master, fool."'
starkcoffee / gist:f822f1804852dcb39dbc1419b59cdd14
Last active Sep 5, 2016
Font tips for code in presentations
View gist:f822f1804852dcb39dbc1419b59cdd14
I got some nice tips from my soundcloud colleagues on what font they used for code in presentations:
I think Consolas looks good
starkcoffee / FutureSpec.scala
Last active Jun 15, 2016
Understanding how futures are executed
View FutureSpec.scala
I wanted to write a specs2 unit test that proves a function works concurrently. I tried writing a unit test
to prove that Futures run concurrently (not always sequentially), just for fun. I ran the test below,
expecting count to equal 1, but it always executed the futures in order, even though C1 takes the longest
time. I realised, I need to go back to school and learn how futures are executed.
"prove futures run in parallel" in new Context {
var count = 0
starkcoffee / bla.scala
Created Jun 2, 2016
Base64 encoding and back in scala
View bla.scala
"prove encoding is a thing" in new Context {
val originalStr = "tschüß"
val base64EncodedStr = Base64.getEncoder.encodeToString(originalStr.getBytes("UTF-8"))
val decodedStr = new String(Base64.getDecoder().decode(base64EncodedStr), "ASCII")
decodedStr ==== originalStr
starkcoffee / gist:42f71f97b80a535ae282
Created Feb 23, 2016
Creating a google calendar template
View gist:42f71f97b80a535ae282
So you can propose an event and people can add it to their calendars.
For the record, here's where I generated the link:
And here's where I've found the recurring parameter which I added to the generated link:
Thanks Alon!
starkcoffee / clock
Last active Feb 4, 2016
my first bash animation!
View clock
echo -en "\033[1B"
while true; do
echo -n '|'
echo -en "\033[1D"
sleep 1
echo -n '/'
echo -en "\033[1D"
View gist:402ca19b5b25e9f56b16
st = status
ca = commit -am
co = checkout
branch-name = !git branch 2>/dev/null | grep -e ^* | tr -d '* '
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
compare = !"open`echo ${PWD##*/}`/compare/`git branch-name`"
implode = !"BN=`git branch-name` && [ $BN != 'master' ] && git co master && git branch -D $BN && git push origin :$BN"
un = !git status --porcelain | grep '??' | awk '{ print $2}'
corb = !git checkout -t
starkcoffee / gist:fbc8b0f3613fd71af710
Last active Aug 29, 2015
Implementing our own 'expect' test function using blocks
View gist:fbc8b0f3613fd71af710
# here's a function which raises an error for some cases
def sum(a,b)
if a < 0 || b < 0
raise ArgumentError, "both arguments must be greater than zero"
a + b
starkcoffee / gist:dd926ad4acbefdf51f69
Created Jun 24, 2014
Restarting mysql on mac, resetting root password
View gist:dd926ad4acbefdf51f69
> mysql.serverstop --skip-grant-tables
> mysql
mysql> UPDATE mysql.user SET Password=PASSWORD('PASSWORD') WHERE User='root';
mysql> exit;
> mysql.server stop
> mysql.server start
You can’t perform that action at this time.