Skip to content

Instantly share code, notes, and snippets.

View stenehall's full-sized avatar
🧗‍♂️

Johan Stenehall stenehall

🧗‍♂️
View GitHub Profile
@stenehall
stenehall / Makefile
Last active December 1, 2020 13:32
Advent of Code
day01:
@deno test --allow-read src/aoc-day1.ts
@stenehall
stenehall / Makefile
Last active November 4, 2020 15:13
Makefile sheet cheat
#: This help command
help:
@grep -B1 -E "^[a-zA-Z0-9_-]+\:([^\=]|$$)" Makefile | grep -v -- -- | sed 'N;s/\n/###/' | sed -n 's/^#: \(.*\)###\(.*\):.*/\2###\1/p' | column -t -s '###'
basic:
echo "This is a basic command, it's also the default command"
basicWithoutCommand:
@echo "Now the command isn't echoed"
@stenehall
stenehall / _stackdriver-log-to-goaccess.md
Last active March 30, 2020 12:03 — forked from DemonGiggle/_stackdriver-log-to-goaccess.md
stackdriver log converts to goaccess format
  1. Use gcloud logging read to pull logs
  2. Convert it to csv style via json2csv.rb
ruby json2csv.rb
  1. Use goaccess to generate html output
@stenehall
stenehall / new-wireguard-peer.sh
Last active April 2, 2024 13:50 — forked from robinlandstrom/new-wireguard-peer.sh
Script to automatically add configration for a new peer to a wireguard server. It will then print a QR code to the console that can be used to add the config to the Android or OS X wireguard client.
#!/bin/bash
readonly INTERFACE="wg0"
# Generate peer keys
readonly PRIVATE_KEY=$(wg genkey)
readonly PUBLIC_KEY=$(echo ${PRIVATE_KEY} | wg pubkey)
readonly PRESHARED_KEY=$(wg genpsk)
# Read server key from interface
@stenehall
stenehall / index.html
Created December 1, 2019 20:31
JS Bin Code advent day 1 - 2 // source https://jsbin.com/tomuvej
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Code advent day 1 - 2">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ramda/0.22.1/ramda.min.js"></script>
@stenehall
stenehall / README.md
Last active September 7, 2018 18:07 — forked from tdack/README.md
Custom handlebars helpers for Ghost, as an app
@stenehall
stenehall / martin.md
Created May 4, 2018 10:37
Martin - Add replenishment car

Hi Martin!

Nice to have you onboard. We'll now move a car.

  • Be at the car by 17.00. If you go by SL you'd have to leave the office att 16.30.
  • Inspect the car for damages.
  • Make sure the car is fully fueled.
  • Make sure the car is clean.

If the car isn't clean

@stenehall
stenehall / photo-grid-1.html
Last active August 11, 2017 20:58
Photo grid example
<ul class="photo-grid" data-grid-basis=150>
<li><img src="https://farm5.staticflickr.com/4409/36432677486_74a964ac55_b.jpg"></li>
<li><img src="https://farm5.staticflickr.com/4413/36081621360_c8b32fc78d_b.jpg"></li>
<li><img src="https://farm5.staticflickr.com/4422/35643136894_e7ecfc0ce3_b.jpg"></li>
</ul>
<script src="/grid.js"></script>
.month
- (0..3).each do |i|
.week
- (1..7).each do |j|
.day{:class => (j%7 == 0 || j%6 == 0) && "day--is-weekend"}
%p
%span #{(i*7)+j}
.week
.day
%p
env ARCHFLAGS="-arch x86_64" gem install --no-rdoc --no-ri mysql2 --
--with-mysql-config=/Applications/MAMP/Library/bin/mysql_config