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
| // server.mjs | |
| import { createServer } from 'node:http'; | |
| const server = createServer((req, res) => { | |
| res.writeHead(200, { 'Content-Type': 'text/html' }); | |
| const quotes = [ | |
| { text: "Simplicity is the ultimate sophistication.", author: "Leonardo da Vinci" }, | |
| { text: "Make it work, make it right, make it fast.", author: "Kent Beck" }, | |
| { text: "What you do every day matters more than what you do once in a while.", author: "Gretchen Rubin" }, |
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 queue import Queue | |
| from concurrent.futures import ThreadPoolExecutor | |
| import threading | |
| def worker(data): | |
| # Pre-process text, create embeddings, or do another compute-intensive tasks | |
| def writer(): | |
| while True: | |
| item = queue.get() |
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 | |
| # run-valgrind.sh - run program under valgrind with custom glibc loader | |
| # Usage: | |
| # ./run-valgrind.sh [valgrind options] -- ./your_program [program args] | |
| GLIBC_DIR="/opt/glibc-debug/lib" | |
| LOADER="$GLIBC_DIR/ld-linux-aarch64.so.1" | |
| if [ ! -x "$LOADER" ]; then | |
| echo "Error: loader $LOADER not found or not executable" |
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
| struct ThumbnailSlideView: View { | |
| // parameters | |
| @Binding var images: [UIImage] | |
| // element sizing | |
| var size: CGFloat = 100 | |
| var spacing: CGFloat = 16 | |
| private var pageSize: CGFloat { size + spacing } | |
| private var marginAdjust: CGFloat { pageSize / 2 } |
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
| // | |
| // CarouselView.swift | |
| // | |
| // Created by xtabbas on 5/7/20. | |
| // Copyright © 2020 xtadevs. All rights reserved. | |
| // Original source available at | |
| // https://gist.github.com/xtabbas/97b44b854e1315384b7d1d5ccce20623 | |
| // | |
| // Modified by Diogo Silva on 30/03/21 | |
| // Modified source available at |
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
| // | |
| // DynamicTextView.swift | |
| // Originally for "Issuing" | |
| // | |
| // Created by Diogo Silva on 12/21/20. | |
| // | |
| import AppKit | |
| import SwiftUI |