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 | |
// Function to create a shared access signature (SAS) token | |
private function getSasToken($accountName, $accountKey, $containerName) | |
{ | |
$sasExpiry = time() + 3600; // Token expires in 1 hour | |
$sasResource = "https://$accountName.blob.core.windows.net/$containerName"; | |
$sasString = utf8_encode(urlencode($sasResource) . "\n$sasExpiry"); | |
$sig = base64_encode(hash_hmac('sha256', $sasString, base64_decode($accountKey), true)); |
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 | |
// Learn more : https://learn.microsoft.com/en-gb/archive/blogs/ptsblog/how-to-upload-a-blob-to-azure-storage-by-rest-api | |
try { | |
// Replace with your Azure storage account details | |
$accountName = 'your account name'; | |
$accountKey = "Your Azure Storage account key | |
$containerName = 'Your container name'; | |
$blobName = 'blob name'; // image.png |
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\Http\Controllers\Api; | |
use App\Http\Controllers\Controller; | |
use App\Models\User; | |
use Illuminate\Http\RedirectResponse; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Auth; | |
use Illuminate\Support\Facades\Hash; |
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 | |
/* | |
* Complete the 'timeConversion' function below. | |
* | |
* The function is expected to return a STRING. | |
* The function accepts STRING s as parameter. | |
*/ | |
function timeConversion($s) { |
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 | |
class culrpost | |
{ | |
protected $url; | |
protected $curl; | |
public $result; |
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 | |
declare(strict_types=1); | |
namespace DemoPhpframework; | |
/** | |
* Dependency Injection from a bible Base Creation Example | |
* | |
* First what is Dependency Injection: |
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 | |
declare(strict_types=1); | |
namespace DemoPhpframework; | |
/** | |
* Dependency Injection from a bible Base Creation Story Example | |
* | |
* First what is Dependency Injection: |
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
table { | |
border-collapse: collapse; | |
border-radius: 1em 1em 0em 0em ; /*** adjust shorthand as you will need **/ | |
overflow: hidden; /** without this property, you wouldn't see the effect **/ | |
} |
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 | |
// | |
$origin = $_SERVER['HTTP_ORIGIN']; | |
if ($origin == "http://www.domain1.com" | |
|| $origin == "http://www.domain2.com" | |
|| $origin == "http://www.domain3.com") { | |
header("Access-Control-Allow-Origin: $origin"); | |
} |