Skip to content

Instantly share code, notes, and snippets.

View JamesTheHacker's full-sized avatar

0xDEADBEEF JamesTheHacker

  • United Kingdom
View GitHub Profile
$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."
]);
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]);
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, {
<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 }}"
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,
module.exports = {
apps: [
{
name: 'API',
script: 'server.js',
env: {
APP_SECRET: process.env.APP_SECRET
},
env_production: {
NODE_ENV: 'production'
# -*- 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"
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
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
#!/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 \