This file contains 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
$container['errorHandler'] = function ($c) { | |
return function ($request, $response, $exception) use ($c) { | |
$c->logger->error('Application Error:', [$exception]); | |
return $c['response'] | |
->withStatus(500) | |
->withHeader('Content-Type', 'application/json') | |
->withJson([ | |
'success' => false, | |
'error' => "Nope, that didn't work. Try again." | |
]); |
This file contains 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
public function add($request, $response, $args) { | |
$user = $request->getParsedBody(); | |
if(!$user) { | |
throw new \Exception('Failed to add user: $user is null'); | |
return; | |
} | |
$validator = \API\Validators\UserRegistration::validate(); | |
$this->logger->info('User:', [$user]); |
This file contains 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
import moment from 'moment' | |
import validate from 'validate.js' | |
import constraints from './validation' | |
import formDataJSON from 'formdata-json' | |
import { appendError, removeError } from '../bulma-form-error' | |
import addUser from './addUser' | |
import bulmaFatalError from '../bulma-fatal' | |
validate.extend(validate.validators.datetime, { |
This file contains 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
<section class="section partners"> | |
<h2 class="section__heading">{{ $.Site.Data.partners.heading }}</h2> | |
<p class="section__description">{{ $.Site.Data.partners.description }}</p> | |
<ul class="carousel partners__carousel"> | |
{{ range $.Site.Data.partners.partners }} | |
<li> | |
<img | |
class="partners__carousel__image" | |
src="{{ .logo }}" |
This file contains 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
local Song = NI.DATA.StateHelper.getFocusSong(App) | |
local ScaleEngine = NI.DATA.getScaleEngine(App) | |
local Group = NI.DATA.StateHelper.getFocusGroup(App) | |
if ScaleEngine and Group then | |
Params = | |
{ | |
ScaleEngine:getRootNoteParameter(), | |
not ScaleEngine:getChordModeIsChordSet() and ScaleEngine:getScaleBankParameter() or nil, |
This file contains 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
module.exports = { | |
apps: [ | |
{ | |
name: 'API', | |
script: 'server.js', | |
env: { | |
APP_SECRET: process.env.APP_SECRET | |
}, | |
env_production: { | |
NODE_ENV: 'production' |
This file contains 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 : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "gbarbieru/xenial" | |
config.vm.network "private_network", ip: "192.168.1.2" | |
config.vm.synced_folder "./data", "/vagrant_data" | |
# Copy keys | |
config.vm.provision "file", source: "./keys/github.pub", destination: "/tmp/github.pub" |
This file contains 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
server 🦄 ssh -t dev 'bash -s' < scripts/provision.sh | |
Pseudo-terminal will not be allocated because stdin is not a terminal. | |
sudo: no tty present and no askpass program specified | |
sudo: no tty present and no askpass program specified | |
sudo: no tty present and no askpass program specified | |
sudo: no tty present and no askpass program specified | |
sudo: no tty present and no askpass program specified | |
sudo: no tty present and no askpass program specified | |
sudo: no tty present and no askpass program specified | |
sudo: no tty present and no askpass program specified |
This file contains 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
server 🦄 npm run api:provision-dev | |
> server@1.0.0 api:provision-dev /Users/spongebob/Projects/fb-app/server | |
> ssh -tt dev 'bash -s' < scripts/provision.sh | |
dev@192.168.0.17's password: | |
#!/bin/bash | |
# Download NodeJS installation script |
This file contains 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
#!/bin/bash | |
# Download NodeJS installation script | |
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - | |
# Install required packages | |
sudo apt-get update | |
sudo add-apt-repository ppa:certbot/certbot | |
sudo apt-get update | |
sudo apt-get install -y \ |