SELECT
users.name AS staff,
facilities.name AS facility
FROM
users
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 php | |
<?php | |
declare(strict_types=1); | |
namespace WaitForElasticsearch; | |
use InvalidArgumentException; | |
use UnexpectedValueException; | |
use function curl_close; |
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 | |
/** | |
* Antes de começar, adicione as possibilidades de | |
* upsell pela página: https://admin.appmax.com.br/my-upsell | |
* | |
* No campo "URL página de Upsell" preencha sua | |
* URL no formato: site.com.br/este-arquivo.php?order_bundle_id={order_bundle_id} | |
* | |
* Obviamente você pode colocar outros parâmetros, | |
* mas seguindo este modelo é obrigatório configurar |
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
Magento 2 Debugging Tricks - MySQL Query, fetchAll, fetchRow, Data Hydrate & PHP xDebug by Matheus Gontijo | |
Video: https://www.youtube.com/watch?v=xLf3OwpAFhQ | |
----------------------------------------------- | |
1) Track MySQL queries | |
vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php::query | |
vendor/magento/zendframework1/library/Zend/Db/Select.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
<?php | |
// php cluter-quick-check --host <host> --port <port> [--auth password] | |
function panicAbort($str_msg) { | |
fprintf(STDERR, "Error: $str_msg\n\n"); | |
$bt = debug_backtrace(); | |
fprintf(STDERR, "--- BACKTRACE ---\n"); | |
foreach (debug_backtrace() as $frame => $frame_info) { |
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
public function index(Request $request) | |
{ | |
$sortBy = 'id'; | |
$orderBy = 'desc'; | |
$perPage = 20; | |
$q = null; | |
if ($request->has('orderBy')) $orderBy = $request->query('orderBy'); | |
if ($request->has('sortBy')) $sortBy = $request->query('sortBy'); | |
if ($request->has('perPage')) $perPage = $request->query('perPage'); |
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 declare(strict_types=1); | |
require_once __DIR__.'/vendor/autoload.php'; | |
use Symfony\Component\Process\Process; | |
$process = new Process(['php', 'index.php']); | |
echo "Starting process\n"; | |
$process->start(); |
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
var request = require('request'); | |
const bitcoin = require('bitcoinjs-lib'); | |
var buffer = require('buffer'); | |
const bitcoinNetwork = bitcoin.networks.testnet; | |
var rootUrl = "https://api.blockcypher.com/v1/btc/test3"; | |
//create wallets | |
const TestNet = bitcoin.networks.testnet3; |
The Laravel explination, shown below is confusing.
Facades provide a "static" interface to classes that are available in the application's service container. Laravel ships with many facades which provide access to almost all of Laravel's features. Laravel facades serve as "static proxies" to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods.
Many examples use Cache::get('key')
to demonstrate how a Facade works. Comparing the following code to the utility that a Facade provides.