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
; Credits: https://www.the-automator.com/ | |
; Create certificate | |
$cert = New-SelfSignedCertificate -Subject "{CertName}" -CertStoreLocation "cert:\CurrentUser\My" -HashAlgorithm sha256 -type CodeSigning | |
; Create password | |
$pwd = ConvertTo-SecureString -String "{123456}" -Force -AsPlainText | |
; Export Certificate to a file | |
Export-PfxCertificate -cert $cert -FilePath {CertName}.pfx -Password $pwd |
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 ( | |
"fmt" | |
"time" | |
) | |
var index int = 0 | |
func main() { |
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 ( | |
"fmt" | |
"time" | |
_ "time/tzdata" // Embed the timezone database | |
) | |
func main() { | |
utcTime := time.Date(2024, time.Now().Month(), 26, 1, 30, 0, 0, time.UTC) |
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
# new line + workdir + $ | |
export PS1="\n\w $ " | |
export PROMPT_DIRTRIM=2 |
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 ( | |
"fmt" | |
"time" | |
) | |
const ( | |
NUM_WORKERS = 100 | |
NUM_JOBS = 1000 |
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 ( | |
"fmt" | |
"sync" | |
) | |
const ( | |
NUM_WORKERS = 10 | |
NUM_JOBS = 10000 |
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: kafka_cluster | |
services: | |
zookeeper: | |
image: confluentinc/cp-zookeeper:7.5.3 | |
container_name: zookeeper | |
environment: | |
ZOOKEEPER_CLIENT_PORT: 2181 | |
ZOOKEEPER_TICK_TIME: 2000 | |
ports: |
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: Deploy SPA | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest |
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: Build SPA | |
on: | |
pull_request: | |
types: [opened, edited, synchronize, reopened, closed] | |
branches: | |
- main | |
jobs: | |
build: |
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
function formatMemoryUsage(data: number) { | |
return `${Math.round((data / 1024 / 1024) * 100) / 100} MB`; | |
} | |
function getCurrentMemoryUsage(): Object { | |
const memoryData = process.memoryUsage(); | |
return { | |
rss: `${formatMemoryUsage(memoryData.rss)} -> Resident Set Size - total memory allocated for the process execution`, | |
heapTotal: `${formatMemoryUsage(memoryData.heapTotal)} -> total size of the allocated heap`, |
NewerOlder