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
#!/bin/bash | |
if ! command -v forge >/dev/null 2>&1 | |
then | |
echo "forge could not be found. Aborting deployment..." | |
exit 1 | |
else | |
echo "forge found" | |
echo | |
fi |
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
#!/bin/bash | |
POSITIONAL_ARGS=() | |
while [[ $# -gt 0 ]]; do | |
case $1 in | |
-rpc|--rpc-url) | |
RPC_URL="$2" | |
shift | |
shift |
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
if ! [ $(docker ps -f "name=${CONTAINER_NAME}" --format '{{.Names}}') == "${CONTAINER_NAME}" ]; then | |
if [ $(docker ps -a -f "status=exited" -f "name=${CONTAINER_NAME}" --format '{{.Names}}') == "${CONTAINER_NAME}" ]; then | |
docker rm ${CONTAINER_NAME} | |
fi | |
docker run --name ${CONTAINER_NAME} \ | |
-e POSTGRES_USER=${DB_USER} \ | |
-e POSTGRES_PASSWORD=${DB_PASSWORD} \ | |
-e POSTGRESS_DB=${DB_NAME} \ | |
-p "${DB_PORT}":5432 \ |
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
{"name":"minh","settings":"{\"settings\":\"{\\n \\\"files.eol\\\": \\\"\\\\n\\\",\\n \\\"workbench.iconTheme\\\": \\\"material-icon-theme\\\",\\n \\\"workbench.colorCustomizations\\\": {\\n \\\"tab.activeBorder\\\": \\\"#42A5F5\\\",\\n \\\"list.activeSelectionBackground\\\": \\\"#42A5F5\\\",\\n \\\"list.inactiveSelectionForeground\\\": \\\"#42A5F5\\\"\\n },\\n \\\"workbench.statusBar.visible\\\": true,\\n \\\"workbench.sideBar.location\\\": \\\"left\\\",\\n \\\"workbench.startupEditor\\\": \\\"none\\\",\\n \\\"workbench.editor.showTabs\\\": \\\"multiple\\\",\\n \\\"editor.tokenColorCustomizations\\\": {\\n \\\"[Material Theme Palenight]\\\": {\\n \\\"textMateRules\\\": [\\n {\\n \\\"scope\\\": [\\\"comment\\\", \\\"comment punctuation.definition.comment\\\"],\\n \\\"settings\\\": {\\n \\\"foreground\\\": \\\"#FFDF7D\\\"\\n }\\n }\\n ],\\n \\\"keywords\\\": \\\"#76E4F7\\\",\\n \\\"types\\\": \\\"#3EA76A\\\"\\n }\\n |
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
export const sleep = async (ms: number): Promise<void> => { | |
return new Promise((resolve) => setTimeout(resolve, ms)); | |
}; |
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
curl -X PUT "localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d' | |
{ | |
"transient": { | |
"cluster.routing.allocation.disk.watermark.low": "30mb", | |
"cluster.routing.allocation.disk.watermark.high": "20mb", | |
"cluster.routing.allocation.disk.watermark.flood_stage": "10mb", | |
"cluster.info.update.interval": "1m" | |
} | |
} | |
' |
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
{ | |
rules: [ | |
"react/jsx-no-leaked-render": ["error", { "validStrategies": ["coerce"] }] | |
] | |
} |
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
using System.Text.Json; | |
namespace YourProject | |
{ | |
public class Json | |
{ | |
public static string Stringify<T>(T input) | |
{ | |
return JsonSerializer.Serialize<T>(input); | |
} |
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
app.UseEndpoints(endpoints => | |
{ | |
endpoints.MapGet("/_proto/", async ctx => | |
{ | |
ctx.Response.ContentType = "text/plain"; | |
using var fs = new FileStream(Path.Combine(env.ContentRootPath, "Proto", "your.proto"), FileMode.Open, FileAccess.Read); | |
using var sr = new StreamReader(fs); | |
while (!sr.EndOfStream) | |
{ | |
var line = await sr.ReadLineAsync(); |
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
#### Open Powershell and run the following commands to install oh-my-posh and posh-git | |
``` | |
Set-ExecutionPolicy Bypass -Scope Process -Force | |
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1')) | |
PowerShellGet\Install-Module posh-git -Scope CurrentUser -Force | |
``` | |
#### Open Notepad to config Powershell profile |
NewerOlder