This file contains hidden or 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
exports.up = function (knex) { | |
return knex.schema.createTable('list', function (t) { | |
t.increments('id'); | |
t.integer('owner_id').notNullable(); | |
t.text('name').notNullable(); | |
t.timestamp('last_modified'); | |
}); | |
}; | |
exports.down = function (knex) { |
This file contains hidden or 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
foo bar | |
baz | |
qux | |
last line (there may or may not be a trailing newline after this line) |
This file contains hidden or 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
var clone = require("./").Clone.clone; | |
function errorLog(err) { | |
console.error(err); | |
} | |
// Look up this known commit. | |
function getCommit(repo) { | |
// Use a known commit sha from this repository. | |
return repo.getCommit("59b20b8d5c6ff8d09518454d4dd8b7b30f095ab5"); |
This file contains hidden or 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
sh: napa: command not found | |
npm ERR! Darwin 14.1.0 | |
npm ERR! argv "node" "/usr/local/bin/npm" "install" | |
npm ERR! node v0.12.0 | |
npm ERR! npm v2.7.3 | |
npm ERR! code ELIFECYCLE | |
npm ERR! [email protected] install: `napa` | |
npm ERR! Exit status 127 | |
npm ERR! |
This file contains hidden or 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
class CustomElement extends HTMLElement { | |
constructor() { | |
super(); | |
} | |
attachedCallback() { | |
this.bindEvents(); | |
} | |
detachedCallback() { |
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
require 'yaml' | |
config_yml = YAML.load_file(File.open(File.expand_path(File.dirname(__FILE__)) + "/vagrant-config.yml")) | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what |
This file contains hidden or 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
"detects no available moves": { | |
"comment": "The board looks like this:", | |
"boardDesc0": "123", | |
"boardDesc1": "231", | |
"boardDesc2": "312", | |
"state": { |
This file contains hidden or 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 storyFiles = require.context('../src', true, /__stories__\/.+\.js$/) | |
const sources = require.context('!!raw-loader!../src', true, | |
/__stories__\/.+\.js$/) | |
const readme = require.context('!!raw-loader!../src', true, /README\.md$/) | |
const READMES = readme.keys().reduce((memo, key) => { | |
const [,baseName] = key.match(/^\.\/([^\/]+)\//) | |
memo[baseName] = readme(key) | |
return memo | |
}, {}) |
This file contains hidden or 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
L=JSON.stringify | |
Z="map" | |
A=(x,y)=>Math.abs(x-y)**2 | |
X='+!!!+!!!++!!!!-!+!+!!!-!!!-+!!!!+!-!!-!+!!!!+!!++!!!+!!+!+!!!!-!!-+!!!-!-!!!-!!!+-!!!!-!-!-!!!+!!!--!!!!+!+!!+!-!!!!+!!+-!!!-!!-!-!!!!-!!--!!!+!!!-!+!+!!!+!!!++!!!!+!-!+!!!-!!!-+!!!!-!-!-!!!-!!!+-!!!!+!+!-!!!+!!!--!!' | |
for(T=[],x=0;x<X.length;)z=()=>(+eval(X[x++]+1)),T.push([[z(),z(),z()],[z(),z(),z()],[z(),z(),z()]]) | |
M=(m,t)=>m.map((_,i)=>m[0]*t[i][0]+m[1]*t[i][1]+m[2]*t[i][2]) | |
Q=[];(await(await fetch("https://adventofcode.com/2021/day/19/input")).text()).split('\n').map(i=>i.replace(/ (\d+)/,(_,n)=>(q=n,Q[n]=[])).replace(/(-?\d+),(-?\d+),(-?\d+)/,(_,x,y,z)=>Q[q].push([+x,+y,+z]))) | |
D=D=>D.map(o=>D.map(p=>A(o[0],p[0])+A(o[1],p[1])+A(o[2],p[2]))) | |
for(R=Q[0],R.l=[0,0,0];Q.filter(q=>!q.l).find(q=>{H=[] | |
for(x in (e=D(R)))for(B in (d=D(q)))d[B].filter(a=>e[x].includes(a)).length>11&&H.push([x,B]) |