Skip to content

Instantly share code, notes, and snippets.

View MartinRosenberg's full-sized avatar
🥑
I do not have avocado hand, so my coding is unimpaired.

Martin Rosenberg MartinRosenberg

🥑
I do not have avocado hand, so my coding is unimpaired.
View GitHub Profile
@MartinRosenberg
MartinRosenberg / Bogorand.c
Last active December 17, 2015 00:10
My roommate's friend knew he needed help with stats/probability. He had no idea he also needed help with his code.
int random;
do
{
random=rand();
} while(random < 1 || random > 100);
@MartinRosenberg
MartinRosenberg / iterm2-solarized.md
Created December 17, 2016 16:26 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font (OS X / macOS)

Solarized

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@MartinRosenberg
MartinRosenberg / python-vs-scala.md
Last active June 20, 2019 02:44
Python vs Scala

Comments

def foo():
    """A multi-line
    docstring.
    """
    pass  # A single-line comment.
// Candidates
const reduceSpread = (users) => {
return users.reduce((acc, user) => {
if (!user.active) {
return { ...acc, [user.id]: user.name }
}
return acc
}, {})
}
@MartinRosenberg
MartinRosenberg / AirdropSorter.scpt
Last active January 22, 2023 23:05 — forked from menushka/airdropSorter.scpt
A Folder Action script written in AppleScript used to separate AirDropped files into a different folder other than the default Downloads folder. See: https://www.idownloadblog.com/2017/03/03/change-airdrop-destination-folder-mac/
property AIRDROP_FOLDER : "Path:to:AirDrop:Folder:in:Alias:format"
property QUARANTINE_KEY : "59"
property GET_QUARANTINE_COMMAND_START : "ls -l -@ '"
property GET_QUARANTINE_COMMAND_END : "' | tr '\\n' ' ' | sed 's/.*com\\.apple\\.quarantine\\s*\\(\\d*\\)/ \\1/' | awk '{$1=$1};1'"
on adding folder items to this_folder after receiving added_items
repeat with i from 1 to length of added_items
set current_item to item i of added_items
set quarantine_type to getQuarantineType(POSIX path of current_item)