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
<select> | |
<option value="AL">Alabama</option> | |
<option value="AK">Alaska</option> | |
<option value="AZ">Arizona</option> | |
<option value="AR">Arkansas</option> | |
<option value="CA">California</option> | |
<option value="CO">Colorado</option> | |
<option value="CT">Connecticut</option> | |
<option value="DE">Delaware</option> | |
<option value="DC">District Of Columbia</option> |
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
//Write a program that prints the numbers 1 to 100, but for every multiple of 3 write "Fizz", | |
//for every multiple of 5 write "Buzz", for every multiple of 3 and 5 write "FizzBuzz" | |
//OutPut | |
//1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, FizzBuzz... | |
//Code Here Below | |
$inputVal = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]; |
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
/** | |
* Filters an array of objects using custom predicates. | |
* | |
* @param {Array} array: the array to filter | |
* @param {Object} filters: an object with the filter criteria | |
* @return {Array} | |
*/ | |
function filterArray(array, filters) { | |
const filterKeys = Object.keys(filters); | |
return array.filter(item => { |
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 | |
$serverName = "sqlserver.example.com"; | |
$database = "myDbName"; | |
$uid = 'sqlserver_username'; | |
$pwd = 'password'; | |
try { | |
$conn = new PDO( | |
"sqlsrv:server=$serverName;Database=$database", | |
$uid, |
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 | |
// Use this class to deserialize error caught | |
use XeroAPI\XeroPHP\AccountingObjectSerializer; | |
use XeroAPI\XeroPHP\PayrollAuObjectSerializer; | |
class ExampleClass | |
{ | |
public $apiInstance; | |
function __construct() { |
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
#!/usr/bin/env bash | |
# Upgrade an Amazon Linux EC2 to PHP 7.3 | |
# | |
# Last tested w/ PHP 7.2 AWS Linux version 2.8.5 | |
# | |
# Must be ran as sudo: | |
# sudo bash upgrade-php7.sh | |
# | |
# Can be added to ./.ebextensions/20_php.config like so: | |
# container_commands: |
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 | |
/** | |
* Get current Laravel active session from outside laravel instance. | |
* Tested Laravel 5.2 | |
* | |
* | |
*/ | |
function getLaravelUser() | |
{ | |
require __DIR__ . '\path\to\bootstrap\autoload.php'; |
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
abuse | |
admin | |
all | |
billing | |
contact | |
everyone | |
ftp | |
jobs | |
list | |
marketing |
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
// I have one native php project and i want to shift session from Laravel 7.3 to Native old PHP 5.6 and i found this method Its working example | |
// Please replace your cookie name here below in the code YOUR_LARAVEL_COOKIE_ID `line 16`. | |
// Also please change the $base64_key get it from your laravel .env file line 14. | |
// `user` thats my custom session key on laravel and i get all the data line 28. | |
try { | |
require_once($_SERVER['DOCUMENT_ROOT'] . "/site/home/vendor/autoload.php"); | |
require_once($_SERVER['DOCUMENT_ROOT'] . "/site/home/bootstrap/app.php"); | |
$kernel = $app->make('Illuminate\Contracts\Http\Kernel'); |
OlderNewer