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
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)) | |
} | |
app.get('/style', async (req, res) => { | |
await sleep(2000) | |
res.sendFile('./public/style.css') | |
}) |
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 type RenderOptions = { | |
title?: string | |
body?: string | |
headTag?: string | |
headers?: HeadersInit | |
} | |
export default function(opts: RenderOptions) { | |
const html = ` | |
<!DOCTYPE html> |
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
import { generateOTPToken, generateSecret, generateQRCode } from './utils.ts' | |
// registering a new user | |
if (username) { | |
const u: User = { | |
username, | |
} | |
const user = await createUser(u) // create your user and create an auth secret |
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
# Updated from YouTube Example | |
# ref: https://developers.google.com/youtube/v3/guides/uploading_a_video | |
# pip install google-api-python-client oauth2client | |
import http.client | |
import httplib2 | |
import os | |
import random | |
import sys | |
import time |
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
ffmpeg -stream_loop -1 -re \ | |
-i video.mp4 \ | |
-vcodec libx264 \ | |
-r 30 -g 30 \ | |
-preset fast -vb 3000k -pix_fmt rgb24 \ | |
-pix_fmt yuv420p \ | |
-f flv \ | |
rtmp://live-fra.twitch.tv/app/live_XXXXXXX_YOUR_KEY |
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
import { Client } from 'postgres' | |
import { CompiledQuery, DatabaseConnection, Driver, QueryResult, TransactionSettings } from 'kysely' | |
type QueryArguments = unknown[] | Record<string, unknown> | |
export class PostgresDriver implements Driver { | |
readonly #connectionMutex = new ConnectionMutex() |
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
import os, time, random | |
import os.path | |
clear = lambda: os.system('cls') | |
clear() | |
def print_logo(): | |
print(f''' | |
\t _____ | |
\t / /\\ |
Source: https://www.reddit.com/r/firefox/comments/li2lqg/now_that_mozilla_killed_the_ssb_feature_what/
- Open URL:
about:profiles
and create a new profile, let's name itssb_prof
- In a terminal (or Win+R on windows) run
firefox --no-remote -P ssb_prof
- Open URL:
about:support
and a. Make sure thatProfile Folder
ends with.ssb_prof
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
from gevent import monkey; monkey.patch_all() | |
from bottle import Bottle, request, abort | |
app = Bottle() | |
@app.route('/ws') | |
def handle_ws(): | |
ws = request.environ.get('wsgi.websocket') | |
if not ws: | |
abort(400, 'Expected a WebSocket request') |