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:
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) => { |
<?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') |
#!/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 |
// 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', |
var Knex = require('knex'); | |
var _ = require('underscore'); | |
Knex.Initialize({ | |
client: 'mysql', | |
connection: { | |
host: 'localhost', | |
user: '', | |
database: '' | |
} |
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; | |
<?php | |
/* | |
* Pretty dump and die | |
*/ | |
function dd($var, $depth=0) | |
{ | |
static $test; | |
if ($depth > 5) { | |
return 'TOO MANY TURTLES!'; |
#!/usr/bin/env php | |
<?php | |
function prompt($msg, $default = false) | |
{ | |
if ($default !== false) | |
{ | |
$msg .= ' ['.$default.']'; | |
} | |
echo $msg.': '; |
#!/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 |