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 interface ListAllOptions<T> extends Deno.KvListOptions { | |
comparer?(a: Deno.KvEntry<T>, b: Deno.KvEntry<T>): number; | |
} | |
export interface ListEntry<T> extends Deno.KvEntry<T> { | |
readonly cursor: string; | |
} | |
export async function listAll<T>( | |
kv: Deno.Kv, |
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
class HTMJ { | |
constructor() { | |
this.init(); | |
} | |
init() { | |
document.addEventListener("DOMContentLoaded", () => { | |
this.parseTemplates(); | |
}); | |
} |
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/sh | |
# Copyright 2023 Khalifah K. Shabazz | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a | |
# copy of this software and associated documentation files (the “Software”), | |
# to deal in the Software without restriction, including without limitation | |
# the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
# and/or sell copies of the Software, and to permit persons to whom the | |
# Software is furnished to do so, subject to the following conditions: |
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
docker run -d --restart=unless-stopped \ | |
-p 80:80 -p 443:443 \ | |
-v /root/rancher:/var/lib/rancher \ | |
--name rancher-server \ | |
rancher/rancher:latest \ | |
--acme-domain <YOUR-DOMAIN-FOR-RANCHER-SERVER> |
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(){ | |
var lastBtn = null | |
document.addEventListener('click',function(e){ | |
if (!e.target.closest) return; | |
lastBtn = e.target.closest('button, input[type=submit]'); | |
}, true); | |
document.addEventListener('submit',function(e){ | |
if (e.submitter) return; | |
var canditates = [document.activeElement, lastBtn]; | |
for (var i=0; i < canditates.length; i++) { |
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
const http = require('http'); | |
const httpProxy = require('http-proxy'); | |
const proxyApi = new httpProxy.createProxyServer({ | |
target: { | |
host: '127.0.0.1', | |
port: 3000 | |
} | |
}); | |
proxyApi.on('error', () => {}); |
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
python -c 'import sys, yaml, json; j=json.loads(sys.stdin.read()); print(yaml.safe_dump(j))' | |
# on windows(PS): | |
# Get-Content example.json | python -c 'import sys, yaml, json; j=json.loads(sys.stdin.read()); print(yaml.safe_dump(j))' > example.yaml | |
# on Unix clones | |
# python -c 'import sys, yaml, json; j=json.loads(sys.stdin.read()); print(yaml.safe_dump(j)) < example.json > example.yaml |
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 | |
DIR="$HOME/bin" | |
cd /tmp | |
curl -s https://api.github.com/repos/cdr/code-server/releases/latest \ | |
| grep "browser_download_url.\+linux-x86_64.tar.gz" \ | |
| cut -d : -f 2,3 \ | |
| tr -d \" \ |
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
# | |
# This is the config file used for the docker images. | |
# It allows all users to do anything, so don't use it on production systems. | |
# | |
# Do not configure host and port under `listen` in this file | |
# as it will be ignored when using docker. | |
# see https://github.com/verdaccio/verdaccio/blob/master/wiki/docker.md#docker-and-custom-port-configuration | |
# | |
# Look here for more config file examples: | |
# https://github.com/verdaccio/verdaccio/tree/master/conf |
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
asn() { | |
if [ -z "$1" ] | |
then | |
echo "usage: asn url" 1>&2 | |
return 1 | |
fi | |
ips=$(dig $DIG_ARGS +short $1) | |
if [ -z "$ips" ] | |
then |
NewerOlder