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
######################### | |
Supervisor | |
######################### | |
First install supervisor | |
apt install supervisor | |
Create a program then give permission to program | |
chmod +x <program_path> |
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
/** | |
* Extended version of function file_put_contents. | |
* | |
* This function will create all dirs in the path to the file, | |
* if they does not exists. | |
* | |
* @param string path to file | |
* @param string file content | |
* @param int flag taken by file_put_contents function | |
* @return bool false on failure, true on success |
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
{ | |
class Test { | |
static assertEquals(test_value, should_value) { | |
return test_value === should_value; | |
} | |
} | |
const string_pyramid = ` | |
1 |
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
.overlay { | |
position: fixed; | |
z-index: 100; | |
top: 0; | |
left: 0; | |
height: 100%; | |
width: 100%; | |
background-color: #000; | |
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=55); | |
opacity: 0.55; |
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
https://stackoverflow.com/questions/16412047/parse-xml-namespaces-with-php-simplexml | |
<?php | |
$data = "http://alerts.weather.gov/cap/tx.php?x=1"; | |
$entries = file_get_contents($data); | |
$entries = new SimpleXmlElement($entries); | |
if(count($entries)): | |
//echo "<pre>";print_r($entries);die; | |
//alternate way other than registring NameSpace | |
//$asin = $asins->xpath("//*[local-name() = 'ASIN']"); |
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
https://stackoverflow.com/questions/16412047/parse-xml-namespaces-with-php-simplexml | |
<?php | |
$data = "http://alerts.weather.gov/cap/tx.php?x=1"; | |
$entries = file_get_contents($data); | |
$entries = new SimpleXmlElement($entries); | |
if(count($entries)): | |
//echo "<pre>";print_r($entries);die; | |
//alternate way other than registring NameSpace | |
//$asin = $asins->xpath("//*[local-name() = 'ASIN']"); |
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 | |
/** | |
* @author: Sohel Rana | |
* @url: https://blog.sohelrana.me/parsing-xml-multiple-namespaces-using-php/ | |
* @license: MIT | |
* Parsing XML with multiple namespaces using PHP | |
*/ | |
$xmlString = "<en:Envelope xmlns:en=\"http://www.softcare.com/HIPAA/SC/Enrollment/0301\" | |
xmlns:sc=\"http://www.softcare.com/HIPAA/SC/0203\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" |
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
$activities = ActivityFeed::with('parentable') | |
->get() | |
->loadMorph('parentable', [ | |
Event::class => ['calendar'], | |
Photo::class => ['tags'], | |
Post::class => ['author'], | |
]); |
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
d3.xml(URL.createObjectURL(new Blob([this.file]))).then(x => { | |
console.log(x); | |
}) |
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
let t =`data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAwIiBoZWlnaHQ9IjQwMCIgdmlld0JveD0iLTEwIC0xMCAyMjAgMjIwIiBzdHlsZT0icGFkZGluZyA6IDEwcHgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgaWQ9InN2Z0dyb3VwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZm9udC1zaXplPSI5cHQiIHN0cm9rZT0iZ3JlZW4iIHN0cm9rZS13aWR0aD0iMC41bW0iIGZpbGw9Im5vbmUiIHN0eWxlPSJzdHJva2U6Z3JlZW47c3Ryb2tlLXdpZHRoOjAuNW1tO2ZpbGw6bm9uZSI+PGcgaWQ9IjAiPjxnIGlkPSJ0cmFwZXplIj48bGluZSBpZD0ibGluZTEiIGRhdGEtcm91dGU9IlsmcXVvdDttb2RlbHMmcXVvdDssJnF1b3Q7dHJhcGV6ZSZxdW90OywmcXVvdDtwYXRocyZxdW90OywmcXVvdDtsaW5lMSZxdW90O10iIHgxPSIwIiB5MT0iMjAwIiB4Mj0iMjAwIiB5Mj0iMjAwIiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiPjwvbGluZT48bGluZSBpZD0ibGluZTIiIGRhdGEtcm91dGU9IlsmcXVvdDttb2RlbHMmcXVvdDssJnF1b3Q7dHJhcGV6ZSZxdW90OywmcXVvdDtwYXRocyZxdW90OywmcXVvdDtsaW5lMiZxdW90O10iIHgxPSIyMDAiIHkxPSIyMDAiIHgyPSIxNzUiIHkyPSIwIiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiPjwvbGluZT48bGluZSBpZD0ibGluZTMiIGRhdGEtcm91dGU9IlsmcXVvdDttb2RlbHMmcXVvdDssJnF1b3Q7dHJhcGV6Z |
NewerOlder