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
{ | |
"meta": { | |
"theme": "elegant", | |
"version": "v1.0.0", | |
"canonical": "https://github.com/jsonresume/resume-schema/blob/v1.0.0/schema.json" | |
}, | |
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json", | |
"basics": { | |
"name": "Nasrul Hazim Mohamad", | |
"label": "Solution Architect, Software Engineer, IT Trainer & Consultant", |
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
package main | |
import ( | |
"crypto/sha256" | |
"encoding/json" | |
"fmt" | |
"strconv" | |
"strings" | |
"time" | |
) |
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\Exceptions; | |
use Exception; | |
class ContractException extends Exception | |
{ | |
public static function throwIf(bool $condition, string $method, ...$args) | |
{ |
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\Actions; | |
class MemoryUtilisation | |
{ | |
public $units = ['B','KB','MB','GB','TB','PB']; | |
public $start; | |
public $startTime; | |
public $end; |
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
CREATE proc [dbo].[sp_MSforeachtable] | |
@command1 nvarchar(2000), @replacechar nchar(1) = N'?', @command2 nvarchar(2000) = null, | |
@command3 nvarchar(2000) = null, @whereand nvarchar(2000) = null, | |
@precommand nvarchar(2000) = null, @postcommand nvarchar(2000) = null | |
AS | |
declare @mscat nvarchar(12) | |
select @mscat = ltrim(str(convert(int, 0x0002))) | |
if (@precommand is not null) | |
exec(@precommand) |
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 Illuminate\Database\Eloquent\Builder; | |
if (! function_exists('dumpSql')) { | |
function dumpSql(Builder $builder) | |
{ | |
return array_reduce($builder->getBindings(), function ($sql, $binding) { | |
return preg_replace('/\?/', is_numeric($binding) ? $binding : "'".$binding."'", $sql, 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
<?php | |
use Illuminate\Database\Eloquent\Builder; | |
if (! function_exists('dumpSql')) { | |
function dumpSql(Builder $builder) | |
{ | |
return array_reduce($builder->getBindings(), function ($sql, $binding) { | |
return preg_replace('/\?/', is_numeric($binding) ? $binding : "'".$binding."'", $sql, 1); | |
}, $builder->toSql()); |
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 (! function_exists('time_period')) { | |
function time_period() | |
{ | |
// Morning: 6 a.m.-noon | |
// Afternoon: noon-6 p.m. | |
// Evening: 6-9 p.m. | |
$value = (int) date('H'); |
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
# Directory Listing | |
Options -Indexes | |
<IfModule mod_security.c> | |
# Server Information Disclosure | |
ServerTokens Prod | |
ServerSignature Off | |
SecServerSignature " " | |
</IfModule> |
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\Casts; | |
use Illuminate\Contracts\Database\Eloquent\CastsAttributes; | |
class UUID implements CastsAttributes | |
{ | |
/** | |
* Cast the given value. |
NewerOlder