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
brew install caddy mkcert nss dnsmasq | |
mkcert -install | |
mkcert '*.app.test' '*.cdn.test' | |
# rename the certs and move them under /usr/local/etc/caddy/certs | |
cat <<EOF > /usr/local/etc/caddy/Caddyfile | |
*.app.test:443, *.cdn.test:443 { |
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 python3 | |
import os | |
import time | |
import subprocess | |
from PIL import ImageGrab , Image | |
from pathlib import Path | |
import io | |
import codecs | |
import tempfile | |
import pyperclip |
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 aioredis import Channel, Redis | |
from fastapi import FastAPI | |
from fastapi.params import Depends | |
from fastapi_plugins import depends_redis, redis_plugin | |
from sse_starlette.sse import EventSourceResponse | |
from starlette.responses import HTMLResponse | |
html = """ | |
<!DOCTYPE html> | |
<html> |
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 'package:flutter/material.dart'; | |
import 'package:get/get.dart'; | |
void main() { | |
runApp(GetMaterialApp( | |
initialRoute: '/login', | |
getPages: [ | |
GetPage( | |
name: '/login', | |
page: () => LoginPage(), |
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 a WSGI web app (like Django) on Windows | |
# see: https://stackoverflow.com/a/48542020/7363740 | |
# Install if necessary | |
conda install waitress | |
pip install waitress | |
# Replace standard `gunicorn` command with `waitress-serve` | |
# for example: gunicorn --listen=*:8000 myapp.wsgi:application | |
waitress-serve --listen=*:8000 myapp.wsgi:application |
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
<script> | |
import timer from './timer.js' | |
// create clock that updates every 500ms | |
const clock = timer({interval: 500}) | |
</script> | |
<!-- Expression will update every 500ms --> | |
Current time is: {$clock} |
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
<script> | |
let s = 0; | |
let m = 0; | |
let active = false; | |
let timer; | |
function setActive(a) { | |
active = a; | |
if(!active) { | |
clearInterval(timer) |
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
<button | |
@click="showModal = !showModal | fetch('{{ entry.url() }}', { | |
headers: { | |
'Content-Type': 'application/json', | |
'X-Requested-With': 'XmlHttpRequest' | |
}, | |
}).then(res => res.text()).then(text => { html = text })" | |
class="flex justify-center animate-grow-on-hover--small" | |
> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Alpine Stopwatch</title> | |
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.js" defer></script> | |
</head> | |
<body> |
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
-- original code: https://github.com/ericelliott/cuid | |
-- Add the "plv8" extension | |
create extension if not exists "plv8"; | |
-- Add the "pgcrypto" extension | |
create extension if not exists "pgcrypto"; | |
\dx | |
-- Connect a database |
NewerOlder