Skip to content

Instantly share code, notes, and snippets.

@optii
optii / config.yml
Last active February 7, 2017 15:13
Semantic UI twig layout using mdehoog/Semantic-UI-Calendar for calendars
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
form_themes:
- 'form/semantic_layout.html.twig'
@optii
optii / hapi.js
Created March 19, 2018 11:24
response
const Hapi = require('hapi');
const Joi = require('joi');
const server = Hapi.server({ port : 4000 });
server.route({
method : 'GET',
path : '/',
handler : (request, h) => {
@optii
optii / hapi-scoped-update.js
Created April 23, 2019 13:17
A quick script to update projects to move to @Hapi scoped packages
'use strict';
const FastGlob = require('fast-glob');
const LatestVersion = require('latest-version');
const ReplaceInFile = require('replace-in-file');
const Fs = require('fs');
const scope = '@hapi/'; // Scope to add to modules
const replaceRequireGlobs = [`${ process.cwd() }/lib/**/*.js`, `${ process.cwd() }/lib/*.js`]; // List of globs or files to replace any requires in
const updateVersion = true; // True to update to the latest version of the dep when changing the scope
const generator = (model) => {
return class extends model {
static get QueryBuilder() {
return class SearchQueryBuilder extends objectionModel.QueryBuilder {