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
| <div id="qrcode"></div> | |
| <script type="text/javascript"> // Change String hereβ | |
| new QRCode(document.getElementById( "qrcode"), "https://blog.suhailkakar.com"); | |
| </script> | |
| <script src="https://cdn.rawgit.com/davidshimjs/qrcodejs/gh-pages/qrcode.min.js"> | |
| </script> |
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
| { | |
| "editor.codeLens": false, | |
| "workbench.colorTheme": "Atom One Dark", | |
| "editor.quickSuggestions": { | |
| "other": false, | |
| "comments": false, | |
| "strings": false | |
| }, | |
| "editor.selectionHighlight": false, | |
| "editor.highlightActiveIndentGuide": false, |
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
| Course::query() | |
| ->select('courses.*') | |
| ->addSelect([ | |
| "lessons count' => Lesson::query () | |
| ->select (DB: : raw( 'COUNT (lessons. id) ')) | |
| ->whereColumn ('lessons.course id','courses. id'), | |
| 'total_length' => Lesson::query() | |
| ->select (DB: : raw ('SUM (lessons. video_length) ')) | |
| ->whereColumn('lessons. course_id', 'courses.id') , | |
| ]) |
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
| function miniMaxSum($arr) { | |
| // Write your code here | |
| $sumatories = []; | |
| foreach($arr as $index => $value){ | |
| $tempArr = $arr; | |
| unset($tempArr[$index]); | |
| $sumatories[] = array_sum($tempArr); | |
| } |
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
| function staircase($n) { | |
| $staircase = 0; | |
| foreach(range(1,$n) as $i){ | |
| echo str_repeat(' ',$n-1).str_repeat('#',$i).PHP_EOL; | |
| $n--; | |
| } | |
| } | |
| staircase(6); |
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
| /** | |
| * Create an UploadedFile object from absolute path | |
| * | |
| * @static | |
| * @param string $path | |
| * @param bool $public default true | |
| * @return object(Symfony\Component\HttpFoundation\File\UploadedFile) | |
| */ | |
| private function pathToUploadedFile( $path, $public = 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
| //https://twitter.com/aarondfrancis/status/1461390854598402048/photo/1 | |
| //you can use Laravel's Schema builder anywhere you want, not just in migrations! | |
| //If you ever need to make a temp table to help you mass process data more quickly, it's a great solution. | |
| public function populateLookupTable($countyId) | |
| { | |
| Schema::dropIfExists ('tmp gis_lookup' | |
| Schema::create ('tmp_gis_lookup', function (Blueprint $table) { | |
| $table->temporary(); |
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
| arch -x86_64 zsh |
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
| sudo spctl --global-enable |
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; | |
| use Illuminate\Database\Eloquent\Model; | |
| use Illuminate\Support\Facades\DB; | |
| class Feature extends Model | |
| { | |
| public function comments() |