Skip to content

Instantly share code, notes, and snippets.

Avatar
🙂
always learning

Alex Jahraus fanaugen

🙂
always learning
  • Berlin
View GitHub Profile
@fanaugen
fanaugen / ruby on ice 2019.md
Created Sep 24, 2019
Ruby on Ice 2019 Notes
View ruby on ice 2019.md
@fanaugen
fanaugen / leipzig.md
Last active Jul 5, 2019
Leipzig Must-see
View leipzig.md

Must-see locations in Leipzig

It depends, of course, on whether you’re looking for nature, culture, history, art, music, or night life, but here are some things to check out:

  • Obviously, city center, Augustusplatz, with its new Mein Building of Leipzig University (that looks like a church, because it was built where the GDR had destroyed a centuries-old church)
  • Thomaskirche, if you want to listen to organ music, or see the final resting ground of the mortal remains of J.S. Bach
  • Moritzbastei – just behind the city skyscraper that is visible from anywhere. This is an underground bar / concert location. Literally underground, with nice round vaults
  • The area around Markt is also worth walking around
  • Clara-Zetkin-Park (esp. area around Sachsenbrücke)
View vim_links.md
@fanaugen
fanaugen / config.fish
Created Jul 26, 2017
fish abbreviation for each git alias
View config.fish
# for each git alias of the form XX, create fish abbreviation gXX
function git_alias --desc "Add a git abbreviation"
abbr -a g$argv[1] git $argv[2]
end
for _alias in (git config --global --get-regexp '^alias\.*' | sed s/alias.//)
git_alias (string split -m1 ' ' "$_alias")
end
@fanaugen
fanaugen / podcasts.md
Last active Jan 9, 2019
dev podcasts
View podcasts.md

📻 My Favourite Podcasts

developer podcasts I’ve listened to

Some of these I still subscribe to, others are no longer in my subsctiption list to make time for non-dev related podcasts

@fanaugen
fanaugen / steamroller.js
Created Jan 12, 2016
recursive function to flatten a js Array
View steamroller.js
function steamroller(arr) {
for (var i = 0; i < arr.length; i++) {
if(Array.isArray(arr[i])) {
// recurse: replace this array with all its elements
// for instance, if arr is [1, [2, 3], 4]
// then we want to return [1, 2, 3, 4]
var left = arr.slice(0, i);
var right = arr.slice(i + 1);
return steamroller(
@fanaugen
fanaugen / export-tasks.sh
Last active Jun 8, 2017
rake tasks to wiki
View export-tasks.sh
#!/bin/bash
# Run `rake -D` and format the task descriptions as a
# GitHub-Markdown table (for our Wiki)
# Write the output to tasks.md
touch tasks.md
echo '<dl>' > tasks.md
bundle exec rake -D |
@fanaugen
fanaugen / comment.md
Created Jun 26, 2013
previous content
View comment.md

echo "Please pick up the following from the store: $groceries[0]";

This isn't going to work by the way: inserting a variable's value into a string "like $x this" only works with a simple variable such as $x – for array elements you have two other options:

  1. String concatenation:

    echo "buy ".$groceries[0]." at the store";
    
  2. save in a variable beforehand:

View gist:5824075

It’s the one whitespace character between the </div> and the next <div!

Because of that whitespace, and because our boxes are displayed as inline-block, the browser renders an actual whitespace in the current font and size between them, and so the smaller box once again breaks to the next "line".