I hereby claim:
- I am christianberg on github.
- I am cberg (https://keybase.io/cberg) on keybase.
- I have a public key whose fingerprint is E40B A1BE 5CAF 2FA4 032C 4D62 187E 8328 A0A6 8B42
To claim this, I am signing this object:
FROM ubuntu:12.04 | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt-get update -y | |
RUN apt-get upgrade -y |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
module RSpec::Puppet | |
module Support | |
@@cache = {} | |
def catalogue(type) | |
vardir = setup_puppet | |
if (type == :host) | |
code = nil |
I hereby claim:
To claim this, I am signing this object:
FROM ubuntu | |
RUN apt-get update | |
RUN apt-get install -y socat | |
VOLUME /foo | |
CMD socat UNIX-LISTEN:/foo/bar.sock - |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>KeepAlive</key> | |
<true/> | |
<key>Label</key> | |
<string>local.runit</string> | |
<key>ProgramArguments</key> | |
<array> |
The one-line solution for part 2 of Day 3 of Advent of Code:
jq -sR '[([1,1],[3,1],[5,1],[7,1],[1,2]) as $slope | ./"\n" | [.,([range(length)]|map(.%$slope[1]))] | transpose | map(select(.[1]==0)|.[0]) | (.[0] | length) as $w| [.,([range(0;length*$slope[0];$slope[0])]|map(.%$w))] | transpose | map(.[0][.[1]:.[1]+1] | select(.=="#")) | length] | reduce .[] as $i (1; . * $i)' < input.txt
And an annotated version. This is the same code as above, with more whitespace, longer variable names, and comments.
[
([1,1],[3,1],[5,1],[7,1],[1,2]) as $slope | ## Loop through all possible slope values, assigning it to the $slope variable.
./"\n" | ## `.` is the entire input file (because we call `jq -sR`). Here we split it into lines.