Skip to content

Instantly share code, notes, and snippets.

View stoffeastrom's full-sized avatar

Christoffer Åström stoffeastrom

View GitHub Profile
@stoffeastrom
stoffeastrom / app.html
Created August 24, 2016 19:50
Aurelia DBMonster with IntersectionObserver
<template>
<require from="./when-visible"></require>
<div>
<table class="table table-striped latest-data">
<tbody>
<tr repeat.for="db of databases">
<td class="dbname">
${db.dbname & oneTime & whenVisible}
</td>
<td class="query-count">
<template>
<require from="./numeric-input"></require>
<numeric-input value.bind="value" callback.call="onBlur()"></numeric-input>
${value}
</template>
@stoffeastrom
stoffeastrom / app.html
Created January 6, 2017 18:03 — forked from martonsagi/app.html
Inline template in custom aurelia component
<template>
<require from="./inline"></require>
<div class="container-fluid">
<h4 class="page-header">Inline template in custom component</h4>
<div class="form-group">
<label>Template:</label>
<input class="form-control" type="text" value.bind="customTemplate" />
</div>
@stoffeastrom
stoffeastrom / app.html
Last active February 17, 2017 20:15 — forked from jdanyow/app.html
Aurelia Gist
<template>
<require from="test"></require>
<h1>${message}</h1>
<div test.call="onTest()"></div>
</template>
@stoffeastrom
stoffeastrom / app.html
Created February 16, 2017 20:31 — forked from jdanyow/app.html
Aurelia Fetch Client Gist
<template>
<require from="async"></require>
<h1>${message}</h1>
<async></async>
</template>
@stoffeastrom
stoffeastrom / docker_images.sh
Created June 28, 2017 07:09 — forked from hydra1983/docker_images.sh
Save and load docker images in batch
#!/bin/bash
readonly DB_FILE="$(pwd)/images.db"
readonly IMG_DIR="$(pwd)/images"
save-images() {
echo "Create ${DB_FILE}"
echo "$(docker images|grep -v 'IMAGE ID'|awk '{printf("%s %s %s\n", $1, $2, $3)}'|column -t)" > "${DB_FILE}"
echo "Read ${DB_FILE}"
@stoffeastrom
stoffeastrom / iterm2-solarized.md
Created March 17, 2018 19:58 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@stoffeastrom
stoffeastrom / migrate-to-lerna.sh
Created April 30, 2018 16:30 — forked from JamieMason/migrate-to-lerna.sh
Bash script to migrate multiple projects into one Lerna monorepo (https://lernajs.io)
#!/usr/bin/env bash
set -x
shopt -s extglob dotglob
cd "$HOME"
rm -rf "$HOME/TEMP_DIR"
mkdir "$HOME/TEMP_DIR"
cd "$HOME/TEMP_DIR"
git init
@stoffeastrom
stoffeastrom / README.md
Created May 30, 2018 12:53 — forked from joyrexus/README.md
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@stoffeastrom
stoffeastrom / bash_strict_mode.md
Created March 31, 2020 07:03 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o pipefail explanation

set -e, -u, -o pipefail

The "set" lines These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing. With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.

set -euo pipefail is short for:

set -e
set -u