Base model for the laravel PHP Framework for use with the Squi UI generation bundle.
Use the Laravel artisan CLI tool to download the bundle:
#!/usr/bin/env php | |
<?php | |
$allow = array('cd', 'ls'); | |
$prompt = 'restrish'; | |
$warning = 'Command not allowed: %s'; | |
/****** TODO LIST | |
- Better parsing of command delimiters (ignore quoted delimiters) | |
- Use readline for command history |
#!/usr/bin/env php | |
<?php | |
function prompt($msg, $default = false) | |
{ | |
if ($default !== false) | |
{ | |
$msg .= ' ['.$default.']'; | |
} | |
echo $msg.': '; |
<?php | |
/* | |
* Pretty dump and die | |
*/ | |
function dd($var, $depth=0) | |
{ | |
static $test; | |
if ($depth > 5) { | |
return 'TOO MANY TURTLES!'; |
user _www; | |
worker_processes 1; | |
#error_log /var/log/nginx.errors; | |
error_log /var/log/nginx.errors notice; | |
#error_log /var/log/nginx.errors info; | |
pid /usr/local/var/run/nginx.pid; | |
var Knex = require('knex'); | |
var _ = require('underscore'); | |
Knex.Initialize({ | |
client: 'mysql', | |
connection: { | |
host: 'localhost', | |
user: '', | |
database: '' | |
} |
// Knex 0.4.11 | |
var Knex = require('knex'); | |
var Q = require('q'); | |
var DB = Knex.initialize({ | |
client: 'mysql', | |
connection: { | |
adapter: 'mysql', | |
database: 'temp', | |
user: 'root', |
#!/bin/bash | |
LOGFILE=/tmp/app-init.log | |
BINPATH=/usr/bin | |
GMPATH=/usr/local/bin/gm | |
WKHTMLPATH="$BINPATH/wkhtmltopdf" | |
function log { | |
echo "[$(date "+%Y-%m-%d %T")] $1" >> $LOGFILE |
<?php | |
/** | |
* Gets the ordinal for a number | |
* | |
* @param integer $number | |
* @param string $format Format to render the number and ordinal | |
* @return string | |
*/ | |
function smarty_modifier_ordinal($number, $format = '%i%s') |
const uploader = new S3UploadStream(s3, { | |
Bucket: bucketName, | |
ContentType: contentType, | |
Key: key, | |
}) | |
stream.pipe(uploader) | |
return new Promise((resolve, reject) => { | |
uploader.on('uploadFinished', (result: CompleteMultipartUploadCommandOutput, fileSizeBytes: number) => { |