The first thing to do is to install Git on the remote server.
Once you do that the rest of the process is split into three sections:
- Server set-up
- Local set-up (push commits)
- Server (pull commits)
//Simple AJAX Polling jQuery Plugin | |
// example usage: | |
/* $.ajaxPoll({ | |
url: "/path", | |
type: "GET", | |
interval: 250, | |
maxAttempts: 25, | |
successCondition: function(result) { | |
return result != "processing"; | |
}, |
<?php | |
/** | |
* Todo: Send a random user agent string and sleep a random amount between requests. | |
*/ | |
if ($_SERVER['REQUEST_METHOD'] == 'POST') { | |
// Extract and sanatize input: | |
$domain = filter_input(INPUT_POST, 'domain', FILTER_SANITIZE_URL); | |
$terms = filter_input(INPUT_POST, 'terms', FILTER_SANITIZE_STRING); | |
// Setup Goutte (which also includes Guzzle): |
<?php | |
/** | |
* Collaborated with http://github.com/pittgikera | |
*/ | |
$text = $_GET['text']; | |
//$questions = "How was is it? # Was it enjoyable?# Did you have fun? # Will you come back?"; | |
$questions = ""; |
//in controller | |
$validator = Validator::make(['one','two','three'], [ | |
'*' => 'exists:table,name', | |
], [ | |
'exists' => '`:value` does not exist.', | |
]); | |
//in service provider boot | |
$this->app->validator->resolver(function($translator, $data, $rules, $messages, $attributes) |
<?php | |
//Search For: | |
Log::(.*?)\((.*[\(\)]*)\); | |
//Replace with | |
Log::info("$1", $2); | |
// Replaces Log::api_unreachable(..) with something like Log::info("api_unreachable", ..); |
#!/bin/sh | |
BACKUP=/var/www/html/mysql_backup/backups | |
cd $BACKUP | |
sudo mkdir `date '+%d-%m-%Y'` | |
NOW=$(date +"%d-%m-%Y") | |
MUSER="user" | |
MPASS="pass" | |
MHOST="host" | |
MYSQL="$(which mysql)" |
/** | |
* Special thanks to http://webcheatsheet.com/php/reading_the_clean_text_from_rtf.php | |
*/ | |
<?php | |
// Function that checks whether the data are the on-screen text. | |
// It works in the following way: | |
// an array arrfailAt stores the control words for the current state of the stack, which show that | |
// input data are something else than plain text. | |
// For example, there may be a description of font or color palette etc. |
for jail in $(fail2ban-client status | grep 'Jail list:' | sed 's/.*Jail list://' | sed 's/,//g'); do fail2ban-client set $jail unbanip IP_ADDRESS_HERE; done |
// Long Polling (Recommened Technique - Creates An Open Connection To Server ∴ Fast) | |
(function poll(){ | |
$.ajax({ url: "server", success: function(data){ | |
//Update your dashboard gauge | |
salesGauge.setValue(data.value); | |
}, dataType: "json", complete: poll, timeout: 30000 }); | |
})(); |