This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.quantamagazine.org/three-math-puzzles-inspired-by-john-horton-conway-20201015/ | |
# via Larene | |
# answer = YOUR_ANSWER | |
not False in [ n % (i+1) == 0 for i, n in enumerate([ (answer // 10**(9-i)) for i in range(10)])] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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."' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I got some nice tips from my soundcloud colleagues on what font they used for code in presentations: | |
http://input.fontbureau.com/ | |
http://hivelogic.com/articles/top-10-programming-fonts/ | |
https://madmalik.github.io/mononoki/ | |
I think Consolas looks good |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So you can propose an event and people can add it to their calendars. | |
For the record, here's where I generated the link: http://kalinka.tardate.com/ | |
And here's where I've found the recurring parameter which I added to the generated link: http://stackoverflow.com/questions/22757908/google-calendar-render-action-template-parameter-documentation#comment56381005_23495015 | |
Thanks Alon! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo -en "\033[1B" | |
while true; do | |
echo -n '|' | |
echo -en "\033[1D" | |
sleep 1 | |
echo -n '/' | |
echo -en "\033[1D" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
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 https://github.com/soundcloud/`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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" | |
end | |
a + b | |
end |
NewerOlder