This file contains 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 -d register_argc_argv=On /home/directyname/public_html/path/artisan schedule:run > /dev/null 2>&1 |
This file contains 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
## .htaccess | |
### ISPConfig folder protection begin ### | |
AuthType Basic | |
AuthName "Members Only" | |
AuthUserFile /path/.htpasswd | |
require valid-user | |
### ISPConfig folder protection end ### | |
SetEnvIf Request_URI "^/url?quertsting" noauth=1 |
This file contains 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
function numbertoword($number) { | |
$units = array('', 'One', 'Two', 'Three', 'Four', | |
'Five', 'Six', 'Seven', 'Eight', 'Nine'); | |
$tens = array('', 'Ten', 'Twenty', 'Thirty', 'Forty', | |
'Fifty', 'Sixty', 'Seventy', 'Eighty', | |
'Ninety'); | |
$special = array('Eleven', 'Twelve', 'Thirteen', | |
'Fourteen', 'Fifteen', 'Sixteen', |
This file contains 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
UPDATE tableA JOIN tabelB USING (id) | |
SET tableA.column = tabelB.column |
This file contains 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
delete table | |
from table | |
inner join ( | |
select max(id) as lastId, product_id | |
from table | |
group by product_id | |
having count(*) > 1) duplic on duplic.product_id = table.product_id | |
where table.id < duplic.lastId; |
This file contains 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
Generating an SSH key pair | |
The first step in using SSH authorization with GitHub is to generate your own key pair. | |
You might already have an SSH key pair on your machine. You can check to see if one exists by moving to your .ssh directory and listing the contents. | |
$ cd ~/.ssh | |
$ ls | |
If you see id_rsa.pub, you already have a key pair and don't need to create a new one. |
This file contains 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 | |
class BinarySearchTree { | |
private $_root; | |
public function __construct() { | |
// setup sentinal node | |
$this->_root = new BinarySearchNode(null); | |
} | |
public function getRoot() { | |
return $this->hasNode() ? $this->_root->right : null; |
This file contains 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 | |
require __DIR__ . '/vendor/autoload.php'; | |
use ElephantIO\Client; | |
use ElephantIO\Engine\SocketIO\Version2X; | |
$options = [ | |
'context' => [ | |
'ssl' => [ |
This file contains 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
<script> | |
var imagesRef = document.getElementsByTagName('img'); | |
for(var i = 0; i < imagesRef.length; i++) { | |
var filename = imagesRef[i].src; | |
var oldAlt = imagesRef[i].alt; | |
if(oldAlt != null){ | |
var newRa = filename.substring(0, filename.lastIndexOf('.')); | |
var imgObj = newRa.split("/"); | |
imagesRef[i].alt = imgObj.slice(-1); | |
} |
This file contains 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
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/1.8.349/pdf.min.js"></script> | |
<button type="button" class="btn btn-default btn-lg tts-btn" title="Upload text, pdf or ebook file"> | |
<span class="glyphicon glyphicon-open-file btn-glyph" aria-hidden="true"></span> | |
<input type="file" id="files" name="files[]"> | |
</button> |
NewerOlder