Skip to content

Instantly share code, notes, and snippets.

@kenberkeley
kenberkeley / config.yml
Last active July 12, 2022 04:01
The simplest CircleCI 2.1 config example for Node / JS projects
## References:
# https://git.io/Jf3l9
# https://circleci.com/docs/2.0/yarn/
# https://circleci.com/docs/2.0/caching/#yarn-node
# https://circleci.com/orbs/registry/orb/circleci/node
# https://discuss.circleci.com/t/circleci-2-1-config-overview/26057
version: 2.1
orbs:
node: circleci/[email protected]
@kenberkeley
kenberkeley / pagesGen.js
Last active October 11, 2019 04:10
pagesGen
{
'landing-page-1': {
entry: './src/pages/landing-page-1/main.js',
template: 'public/index.html',
filename: 'landing-page-1.html',
title: 'Landing Page 1',
chunks: [ 'chunk-vendors', 'chunk-common', 'landing-page-1' ]
},
'landing-page-2': {
entry: './src/pages/landing-page-2/main.js',
@kenberkeley
kenberkeley / nuxt-request-with-client-cache.js
Last active July 21, 2020 04:12
Nuxt.js: Ajax with client cache
import axios from 'axios'
import hashSum from 'hash-sum' // for key gen
import clone from 'fast-copy' // for cutting the reference
/**
* Nuxt.js: request with client cache (imitate Google search association results)
* @param {Object} req
* @param {string} [req.method='get']
* @param {string} req.url
* @param {Object} [req.data]