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
USE test; | |
DROP TABLE IF EXISTS uber_request_logs; | |
CREATE TABLE IF NOT EXISTS | |
uber_request_logs ( | |
request_id INT(11), | |
request_date DATE, | |
request_status VARCHAR(255), | |
distance_to_travel FLOAT, |
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 | |
namespace App\Console\Commands; | |
use Illuminate\Console\Command; | |
use Symfony\Component\Process\Exception\ProcessFailedException; | |
use Symfony\Component\Process\Process; | |
class DumpTableDataToSQL extends Command | |
{ |
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 | |
namespace App\Console\Commands; | |
use Illuminate\Console\Command; | |
use Symfony\Component\Process\Exception\ProcessFailedException; | |
use Symfony\Component\Process\Process; | |
class ImportTableWithDataFromSQL extends Command | |
{ |
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
// https://caniuse.com/?search=line-clamp - way around line-clamp needed | |
@mixin ellipsis-for-lines($max-lines: 3) { | |
/* stylelint-disable */ | |
display: -moz-box; | |
display: -webkit-box; | |
text-overflow: ellipsis; | |
-webkit-line-clamp: $max-lines; | |
-webkit-box-orient: vertical; | |
-moz-line-clamp: $max-lines; | |
-moz-box-orient: vertical; |
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
{ | |
"name": "laravel/laravel", | |
"type": "project", | |
"description": "The Laravel Framework.", | |
"keywords": [ | |
"laravel" | |
], | |
"license": "MIT", | |
"require": { | |
"php": "^7.3", |
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 | |
namespace Tests\Feature; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Foundation\Testing\TestCase as BaseTestCase; | |
use Tests\CreatesApplication; | |
class LaravelSqliteBug extends BaseTestCase |
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
-- EXISTS "query_cost": "12.80" | |
EXPLAIN format=json SELECT * FROM `property_states` | |
WHERE EXISTS | |
(SELECT `state` FROM `listing_geos` | |
WHERE `property_states`.`name` = `listing_geos`.`state` | |
AND EXISTS (SELECT `id`, | |
`status` FROM `listings` | |
WHERE `listing_geos`.`listing_id` = `listings`.`id` | |
AND `status` = 3) |
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
// assing level-3 property L3 fast | |
const obj = { | |
L1: { | |
L21: { | |
L3: 'Hello L3' | |
}, | |
L22: null | |
}, | |
L12: 22 | |
}; |
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 | |
/** | |
* If stdClass property doesn't exist we provide "[NOT_PROVIDED]" string | |
* | |
* @param stdClass $settingsObj | |
* @return stdClass | |
*/ | |
function getDefaultIfPopertyDoesntExist(\stdClass $stdObj): \stdClass | |
{ | |
return new class($stdObj) extends \stdClass { |
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
// logs 3 arguments to the console | |
const testFunc = (a, b, c) => { console.log(`a: ${a}, b: ${b}, c: ${c}`); } | |
// calls callback with only ONE argument (so TWO are missing) | |
const giveOnlyC = (callback) => { callback("CCC"); }; | |
// before we send the callback to the `giveOnlyC` we can "pre-configure" its first TWO arguments like this | |
giveOnlyC( testFunc.bind(null, "AAA", "BBB") ); // a: AAA, b: BBB, c: CCC |