Skip to content

Instantly share code, notes, and snippets.

View kareypowell's full-sized avatar
👨‍💻
Working from home

Karey H. Powell kareypowell

👨‍💻
Working from home
View GitHub Profile
<?php
namespace App\Console\Commands;
use App\User;
use Hyn\Tenancy\Contracts\Repositories\CustomerRepository;
use Hyn\Tenancy\Contracts\Repositories\HostnameRepository;
use Hyn\Tenancy\Contracts\Repositories\WebsiteRepository;
use Hyn\Tenancy\Environment;
use Hyn\Tenancy\Models\Customer;
mysql> show status like '%onn%';
+--------------------------+---------+
| Variable_name | Value |
+--------------------------+---------+
| Aborted_connects | 50 |
| Connections | 1003668 |
| Max_used_connections | 729 |
| Ssl_client_connects | 0 |
| Ssl_connect_renegotiates | 0 |
| Ssl_finished_connects | 0 |
>> MySQLTuner 1.6.19 - Major Hayden <major@mhtx.net>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.5.52-0+deb8u1
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MEMORY +MRG_MYISAM +MyISAM +PERFORMANCE_SCHEMA
Route::group(['domain' => env('MAIN_DOMAIN'), 'middleware' => ['web']], function() {
Route::get('/', 'SignupsController@index');
Route::post('/create-organization', 'SignupsController@registerOrganization');
});
Route::group(['domain' => '{tenant}.' . env('MAIN_DOMAIN'), 'middleware' => ['web']], function () {
Route::get('login', 'Auth\AuthController@showLoginForm');
...
});
App::singleton('tenant', function($app) {
$server = explode('.', Request::getHost());
if (count($server) === 3 && $server[0] !== 'www') {
$organization = Organization::where('slug', $server[0])->firstOrFail();
return $organization;
}
});
@kareypowell
kareypowell / gist:000af161df824e9d5ea2
Last active October 23, 2015 07:55
SendEMailWSService.php
<?php
namespace SendEMailWSService {
/**
* @property boolean $error
* @property string $message
*/
class result {
public $error;
public $message;
SELECT
branch.NAME AS RegionalCentre, COUNT(loanaccount.ID) AS LoansOutstanding,
SUM(loanaccount.PRINCIPALBALANCE) AS PrincipalBalance,
(
CASE
WHEN DATEDIFF(CURRENT_DATE, loanaccount.LASTSETTOARREARSDATE) > 7 THEN SUM(loanaccount.PRINCIPALBALANCE)
ELSE 0
END
) AS ValueAtRisk
FROM loanaccount
$config = {
"application" => "DOMAIN.TLD",
"repository" => "git@GITHOST:USERNAME/REPOSITORYNAME.git",
"remoteusername" => "REMOTEUSERNAME",
"cake_folder" => "/PATH/TO/CAKE",
"cake_version" => "cakephp1.3",
"plugin_dir" => "plugins",
"servers" => {
"prod" => {
"server" => "APPLICATION.TLD",
# Guide
# Configure the essential configurations below and do the following:
#
# Repository Creation:
# cap deploy:repository:create
# git add .
# git commit -am "initial commit"
# git push origin master
#
# Initial Deployment:
@kareypowell
kareypowell / nginx.conf
Last active December 14, 2015 18:29
Nginx.conf lean configurations
# Checkout the Slicehost article for a minute nginx.conf, and the H5BP config for 'docs'
# http://articles.slicehost.com/2009/3/4/ubuntu-intrepid-nginx-from-source-layout
# https://github.com/h5bp/server-configs/blob/master/nginx/nginx.conf
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
worker_rlimit_nofile 8192;