Skip to content

Instantly share code, notes, and snippets.

@camshaft
camshaft / experiment.js
Last active June 26, 2018 19:37
multiple google experiments
function choose(id, cb) {
var i = document.createElement('iframe');
i.setAttribute('sandbox', 'allow-scripts allow-same-origin');
document.body.appendChild(i);
var win = i.contentWindow.window;
win.loaded = function() {
cb(cxApi.chooseVariation());
};
var doc = win.document;
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Font
:set guifont=Source\ Code\ Pro:h14
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Hide pointless junk at the bottom, doesn't work in .vimrc for some reason?
:set laststatus=0
:set noshowmode "don't show --INSERT--
:set noruler "don't show line numbers/column/% junk
@jthegedus
jthegedus / next-aso-ssg-export.js
Last active April 20, 2022 18:57
Next.js static asset hoisting for Firebase Hosting CDN
var shell = require("shelljs");
var nextjsConfig = require("../next.config");
var distDir = nextjsConfig.distDir || ".next";
var BUILD_ID = shell.cat(`${distDir}/BUILD_ID`);
function hoistPages(fileExt, outputPath) {
console.log(
`${distDir}/server/static/${BUILD_ID}/pages/**/*${fileExt} -> ${outputPath}/`
);
shell.mkdir("-p", outputPath);