This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Find ubuntu ami_id | |
ec2_ami_search: | |
distro: ubuntu | |
release: trusty | |
region: "{{ aws_region }}" | |
store: ebs-ssd | |
virt: hvm | |
register: ubuntu | |
when: not aws_ami_id is defined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
"use strict"; | |
var pair = (function () { | |
function cons(x, y) { | |
return function (pick) { | |
return pick ? x : y; | |
}; | |
} | |
function car(pair) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*eslint no-confusing-arrow: off*/ | |
const {map, pipe, split, head, tail, reduce, last, range, add, repeat, chain, equals} = require('ramda'); | |
const input = 'R3, L5, R1, R2, L5, R2, R3, L2, L5, R5, L4, L3, R5, L1, R3, R4, R1, L3, R3, L2, L5, L2, R4, R5, R5, L4, L3, L3, R4, R4, R5, L5, L3, R2, R2, L3, L4, L5, R1, R3, L3, R2, L3, R5, L194, L2, L5, R2, R1, R1, L1, L5, L4, R4, R2, R2, L4, L1, R2, R53, R3, L5, R72, R2, L5, R3, L4, R187, L4, L5, L2, R1, R3, R5, L4, L4, R2, R5, L5, L4, L3, R5, L2, R1, R1, R4, L1, R2, L3, R5, L4, R2, L3, R1, L4, R4, L1, L2, R3, L1, L1, R4, R3, L4, R2, R5, L2, L3, L3, L1, R3, R5, R2, R3, R1, R2, L1, L4, L5, L2, R4, R5, L2, R4, R4, L3, R2, R1, L4, R3, L3, L4, L3, L1, R3, L2, R2, L4, L4, L5, R3, R5, R3, L2, R5, L2, L1, L5, L1, R2, R4, L5, R2, L4, L5, L4, L5, L2, L5, L4, R5, R3, R2, R2, L3, R3, L2, L5'; | |
const headings = [[1, 0], [0, -1], [-1, 0], [0, 1]]; | |
const bear = (heading, dir) => headings[(4 + headings.indexOf(heading) + dir) % 4]; | |
const bearings = {R: 1, L: -1}; | |
const scaleV2 = ([[a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const {split, pipe, map, reduce, filter, identity} = require('ramda'); | |
const transitions1 = { | |
1: {R: 2, D: 4}, | |
2: {R: 3, L: 1, D: 5}, | |
3: {L: 2, D: 6}, | |
4: {R: 5, U: 1, D: 7}, | |
5: {U: 2, D: 8, L: 4, R: 6}, | |
6: {U: 3, D: 9, L: 5}, | |
7: {U: 4, R: 8}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//eslint-disable-next-line no-sync | |
const input = require('fs').readFileSync(process.argv[2]).toString(); | |
const {pipe, split, map, sort, flip, subtract, filter, splitEvery, transpose, take, concat, lt, __, prop, reduce, head, tail, identity} = require('ramda'); | |
const numericalMatrix = pipe( | |
split('\n'), | |
filter(identity), | |
map(split(/\s/)), | |
map(filter(identity)), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const input = require('./input'); | |
const {pipe, split, map, join, last, init, filter, sort, curry, compose, converge, add, find, prop, equals, take, over, sortBy, reduce, head, identity, lensIndex} = require('ramda'); | |
const roomRegex = /^(\d+)\[(.+)\]$/; | |
const roomParse = s => { | |
//eslint-disable-next-line no-unused-vars | |
const [_, sector, checksum] = roomRegex.exec(s); | |
return [parseInt(sector, 10), checksum]; | |
}; | |
const firstLens = lensIndex(0); | |
const alphabet = 'abcdefghijklmnopqrstuvwxyz'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const input = 'abbhdwsy'; | |
const {Seq: seq, Set: set, Range: range} = require('immutable'); | |
const md5 = require('md5'); | |
const {equals, compose, take, complement, gt, head, prop} = require('ramda'); | |
function logger(x) { | |
console.log(x); | |
return x; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const input = require('./input'); | |
const {histogram} = require('./helper'); | |
const {pipe, split, transpose, map, join, head, invoker, sort, prop, sortBy} = require('ramda'); | |
const histogramFrequency = pipe( | |
split('\n'), | |
transpose, | |
map(join('')), | |
map(sort((x, y) => x.localeCompare(y))), | |
map(histogram), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const input = require('./input'); | |
const {pipe, split, intersection, converge, compose, prop, concat, map, length, join, or, filter, any, none, aperture, dissoc, over, curry, invoker, reduce, assoc, lensProp} = require('ramda'); | |
const removeNets = curry((nets, original) => | |
reduce((final, hypernet) => final.replace(hypernet, ' '), original, nets)); | |
const slice2 = invoker(2, 'slice'); | |
const isAbba = s => s[0] !== s[1] && s[0] === s[3] && s[1] === s[2]; |
OlderNewer