function Invoke-CmdScript {
param(
[String] $scriptName
)
$cmdLine = """$scriptName"" $args & set"
& $env:SystemRoot\system32\cmd.exe /c $cmdLine |
Select-String '^([^=]*)=(.*)$' | ForEach-Object {
$varName = $_.Matches[0].Groups[1].Value
$varValue = $_.Matches[0].Groups[2].Value
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
// generate array 1 - 10 | |
const nums = [...Array.from(10).keys()].map(x => ++x) | |
// [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] | |
// dimulai dari 0 | |
const nums = [...Array.from(10).keys()] | |
// [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] |
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
DB_HOST=127.0.0.1 | |
DB_USER=user | |
DB_PASSWD=password | |
DB_NAME=test |
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); | |
namespace App\Helpers; | |
use Illuminate\Database\Query\Builder; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\DB; | |
use Illuminate\Support\Facades\Log; |
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 | |
// Sebelum query aktifkan log query | |
DB::enableQueryLog(); | |
$query = DB::table('demo')->where('id', '=', 1); | |
// Setelah query get lognya. | |
Log::error(print_r(DB::getQueryLog(), true)); |
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
<div id="canvas"></div> | |
<style> | |
#canvas { | |
width: 500px; | |
height: 300px; | |
border: 5px solid black; | |
position: relative; | |
box-sizing: content-box; | |
} |
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
#!/bin/bash | |
RUSTFLAGS='-C target-feature=+crt-static' cargo build --release --target x86_64-unknown-linux-musl | |
# hasil compile diatas akan bisa dieksekusi disemua os linux |
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 strict' | |
function fetchTimeout(url, timeout, {signal, ...options} = {}) { | |
function createJqueryAjaxAbortAdapter(signal) { | |
return function(jqXhr) { | |
signal.addEventListener("abort", () => { | |
jqXhr.abort(); | |
}); | |
}; | |
} |
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 strict' | |
const fetchTimeout = (url, ms, {signal, ...options} = {}) => { | |
const controller = new AbortController() | |
const promise = fetch(url, {signal: controller.signal, ...options}) | |
if (signal) signal.addEventListener('abort', () => controller.abort()) | |
const timeout = setTimeout(() => controller.abort(), ms) | |
return promise.finally(() => clearTimeout(timeout)) | |
} |
NewerOlder