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 count(firstName) as total from students where firstName = 'John' |
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 name from employees where managerId is not null |
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 | |
class Palindrome | |
{ | |
public static function isPalindrome($string) | |
{ | |
$string = str_replace(' ', '', $string); | |
$string = preg_replace('/[^A-Za-z0-9\-]/', '', $string); | |
$string = strtolower($string); |
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 | |
class Pipeline | |
{ | |
public static function make_pipeline(...$funcs) | |
{ | |
return function ($arg) use ($funcs) | |
{ | |
foreach ($funcs as $function) { | |
if(!isset($value)) | |
$value = $function($arg); |
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 | |
$data = "1,2,3,4,5,6,7"; // String | |
$sum = array_sum(explode(',', $data)); | |
print_r($sum); |
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\Http\Controllers\System; | |
use App\Http\Controllers\Controller; | |
use App\User; | |
Class SampleClass extends Controller { | |
public function store() |
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 | |
class DragonBall { | |
public $ballCount = 0; | |
public function iFoundBall($loop) { | |
for ($i = 0; $i < $loop; $i++) { | |
$ball = $this->ballCount+=1; |
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
# deb cdrom:[Ubuntu 19.10 _Eoan Ermine_ - Release amd64 (20191017)]/ eoan main restricted | |
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to | |
# newer versions of the distribution. | |
deb http://id.archive.ubuntu.com/ubuntu/ eoan main restricted | |
# deb-src http://id.archive.ubuntu.com/ubuntu/ eoan main restricted | |
## Major bug fix updates produced after the final release of the | |
## distribution. | |
deb http://id.archive.ubuntu.com/ubuntu/ eoan-updates main restricted |
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 instagram = [{ | |
"name": "Instagram", | |
"icon": "https://example.com/instagram.jpg", | |
"quota": { | |
"quota": 10, | |
"unit": "GB" | |
} | |
}, | |
{ | |
"name": "Instagram", |
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
const calculationBetweenTimes = (startTime, endTime) => { | |
let diff = moment(endTime, 'HH:mm').diff(moment(startTime, 'HH:mm')) | |
let d = moment.duration(diff); | |
let hours = Math.floor(d.asHours()); | |
let minutes = moment.utc(diff).format("mm"); | |
return { | |
hours: hours, | |
minutes: minutes, | |
} | |
}; |
OlderNewer