Skip to content

Instantly share code, notes, and snippets.

@humancatfood
humancatfood / gh-pages-deploy.md
Created April 11, 2019 14:13 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

{
"env": {
"node": true,
"browser": true,
"es6": true,
"jest": true
},
"extends": [
"eslint:recommended"
],
const phrases = `
oaoe rxeq vssdqtu xrk cjv yaoqp loo
mveua dogbam szydvri hyzk lbega abzqw xwjn wniug kwbre
npaoy uivpxwd oynpa rcdk uixpvdw
yserir iikzcm ieuroca iuwcfov rvb giti crdpdcv mxpps
spyuhgo lucasl ucllsa bymnjig yflbv nxitmlf
xlxyhwz xla mpye fvjegwg fezlfrt inetrh vhg xpvstx ydhvq
xgue cvtmh myg ontvvyw ygm oqzrdrw
srdfsjf dli kccb kauk kauk apa doefc cdffkhh cdffkhh
msizb elqiov lqn epamk onmnlst baawab ncafwaf jrataml iyzhy svycuec
// data spiral
// 147 142 133 122 59
// 304 5 4 2 57
// 330 10 1 1 54
// 351 11 23 25 26
// 362 747 806---> ...
function getStepsToData (target)
{
// a grid to keep track of the spiral
@humancatfood
humancatfood / aoc2017-03-1.js
Last active December 15, 2017 20:23
Advent Of Code 2017 - 03(1) http://adventofcode.com/2017/day/3
// data spiral
// 17 16 15 14 13
// 18 5 4 3 12
// 19 6 1 2 11
// 20 7 8 9 10
// 21 22 23---> ...
function getStepsToData (target)
{
const directions = [[1, 0], [0, 1], [-1, 0], [0, -1]];
@humancatfood
humancatfood / aoc2017-02-2.js
Last active December 13, 2017 03:18
Advent Of Code 2017 - 02(2) http://adventofcode.com/2017/day/2
const { max, min } = Math;
const input = `
157 564 120 495 194 520 510 618 244 443 471 473 612 149 506 138
1469 670 47 604 1500 238 1304 1426 54 749 1218 1409 60 51 1436 598
578 184 2760 3057 994 167 2149 191 2913 2404 213 1025 1815 588 2421 3138
935 850 726 155 178 170 275 791 1028 75 781 138 176 621 773 688
212 977 297 645 229 194 207 640 804 509 833 726 197 825 242 743
131 43 324 319 64 376 231 146 382 162 464 314 178 353 123 446
551 121 127 155 1197 288 1412 1285 557 137 145 1651 1549 1217 681 1649
@humancatfood
humancatfood / aoc2017-02-1.js
Last active December 13, 2017 02:25
Advent Of Code 2017 - 02(1) http://adventofcode.com/2017/day/2
const input = `
157 564 120 495 194 520 510 618 244 443 471 473 612 149 506 138
1469 670 47 604 1500 238 1304 1426 54 749 1218 1409 60 51 1436 598
578 184 2760 3057 994 167 2149 191 2913 2404 213 1025 1815 588 2421 3138
935 850 726 155 178 170 275 791 1028 75 781 138 176 621 773 688
212 977 297 645 229 194 207 640 804 509 833 726 197 825 242 743
131 43 324 319 64 376 231 146 382 162 464 314 178 353 123 446
551 121 127 155 1197 288 1412 1285 557 137 145 1651 1549 1217 681 1649
1723 1789 5525 4890 3368 188 3369 4842 3259 2502 4825 163 146 2941 126 5594
311 2420 185 211 2659 2568 2461 231 2599 1369 821 506 2227 180 220 1372
const input = '8182759779311661784248926537799313421565672689468495979489444698638182481143275248241369244868917947392816687416168186146132225851327423861686875179394329117538468179974735556938213169184734744597887149176657943367536288362311595787348134856872472732889262169769925163144158369856113546828218927939839227553955775928599599665743297876939342422331599478467572795239392178441943465994948584595827983267995125713652946739789559284169551272116242341434975467293486878443178642438592386653267844143496189858322592247618573713891336357118194769698545841235895661634917964421678158995397882371183392186991374975329324922269488923625549373814973894699813469719982716443629448398839539676986654273145924389581816976395946311429911563272574131866219233696324669188369512775194216952649869422617812564123777112458253794129788761342673847936947567322467997394647212154464779727378834456156647559234414417811289333695856559256152575484996288782421224349791979695699719613793677564998845374338392178357282637984318746543171
const input = '8182759779311661784248926537799313421565672689468495979489444698638182481143275248241369244868917947392816687416168186146132225851327423861686875179394329117538468179974735556938213169184734744597887149176657943367536288362311595787348134856872472732889262169769925163144158369856113546828218927939839227553955775928599599665743297876939342422331599478467572795239392178441943465994948584595827983267995125713652946739789559284169551272116242341434975467293486878443178642438592386653267844143496189858322592247618573713891336357118194769698545841235895661634917964421678158995397882371183392186991374975329324922269488923625549373814973894699813469719982716443629448398839539676986654273145924389581816976395946311429911563272574131866219233696324669188369512775194216952649869422617812564123777112458253794129788761342673847936947567322467997394647212154464779727378834456156647559234414417811289333695856559256152575484996288782421224349791979695699719613793677564998845374338392178357282637984318746543171