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
(cors) { | |
@cors_preflight{args.0} method OPTIONS | |
@cors{args.0} header Origin {args.0} | |
handle @cors_preflight{args.0} { | |
header { | |
Access-Control-Allow-Origin "{args.0}" | |
Access-Control-Allow-Methods "GET, POST, PUT, PATCH, DELETE, OPTIONS" | |
Access-Control-Allow-Headers * | |
Access-Control-Max-Age "3600" |
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
import { load } from "https://deno.land/std@0.214.0/dotenv/mod.ts"; | |
import jwtEncode from "https://esm.sh/jwt-encode@1.0.1"; | |
const env = await load(); | |
// create jwt token for publishing | |
const jwtSecret = env["JWT_SECRET_KEY"]; | |
const jwtPayload = { | |
mercure: { | |
publish: ["/messages/{event}"], |
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
export function parseAnsibleArgs(argsStr: string) { | |
const parsedArgs: Record<string, string | boolean | string[] | null> = {}; | |
const argRegex = /(\S+)=('[^']*'|[^ ]+)/g; | |
const matches = argsStr.matchAll(argRegex); | |
for (const match of matches) { | |
const key = match[1]; | |
let value = match[2]; | |
if (value === "None") { |
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
#!/usr/bin/env -S deno run --unstable --allow-read --allow-write --allow-run --allow-net | |
import { ensureDirSync } from "https://deno.land/std@0.123.0/fs/mod.ts"; | |
import { join } from "https://deno.land/std@0.123.0/path/mod.ts"; | |
import pLimit from "https://cdn.skypack.dev/p-limit@v4.0.0"; | |
function readJson(file: string) { | |
const jsonString = Deno.readTextFileSync(file); | |
const json = JSON.parse(jsonString); | |
return json; | |
} |
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
//+------------------------------------------------------------------+ | |
//| ball6847_SendOrder.mq4 | | |
//| Copyright 2021, MetaQuotes Software Corp. | | |
//| https://www.mql5.com | | |
//+------------------------------------------------------------------+ | |
#property copyright "Copyright 2021, MetaQuotes Software Corp." | |
#property link "https://www.mql5.com" | |
#property version "1.00" | |
#property strict | |
#property script_show_inputs |
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
# run this as root | |
echo 1 > /proc/sys/vm/drop_caches | |
echo 1 > /proc/sys/vm/compact_memory | |
sh -c "echo 1 > /proc/sys/vm/drop_caches; 1 > /proc/sys/vm/compact_memory" |
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
version: '3' | |
services: | |
prerender: | |
image: ball6847/prerender:5.6.0-1 | |
restart: unless-stopped | |
environment: | |
CACHE_TTL: 86400 | |
CACHE_DIR: /tmp/prerender | |
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
import { SimpleChanges } from '@angular/core'; | |
type SimpleChanges<T> = Record<keyof T, SimpleChange> |
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
FROM ball6847/vscode-remote-dotnet:1.1.4 |
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
# dotnet-install.sh | |
# follow the instuction here https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script | |
# or if you dont want to read, then run | |
wget https://dot.net/v1/dotnet-install.sh | |
# make this file in our PATH, I already have my profile based PATH setup at ~/.local/bin | |
# then give it a permission to be executed | |
mv dotnet-install.sh ~/.local/bin | |
chmod +x ~/.local/bin/dotnet-install.sh |
NewerOlder