This file contains hidden or 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
<?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; |
This file contains hidden or 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
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 | |
This file contains hidden or 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
>> MySQLTuner 1.6.19 - Major Hayden <[email protected]> | |
>> 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 |
This file contains hidden or 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
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'); | |
... | |
}); |
This file contains hidden or 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
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; | |
} | |
}); |
This file contains hidden or 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
<?php | |
namespace SendEMailWSService { | |
/** | |
* @property boolean $error | |
* @property string $message | |
*/ | |
class result { | |
public $error; | |
public $message; |
This file contains hidden or 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
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 |
This file contains hidden or 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
$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", |
This file contains hidden or 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
# 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: |
This file contains hidden or 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
# 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; |
NewerOlder