Instantly share code, notes, and snippets.

💭
Set status

# Wildan Zulfikar wzulfikar

💭
Set status
Created October 13, 2023 16:19
Sample textbooks

# 1. Algorithm Design and Analysis

One important aspect of algorithm design is problem-solving strategies. This involves breaking down a complex problem into smaller, more manageable subproblems. By solving these subproblems, we can then combine their solutions to solve the original problem. This approach is known as the divide-and-conquer method.

Another important aspect of algorithm design is understanding the time and space complexity of an algorithm. Time complexity refers to the amount of time an algorithm takes to run, while space complexity refers to the amount of memory an algorithm requires. By analyzing the time and space complexity of an algorithm, we can determine its efficiency and scalability.

For example, let's consider the problem of finding the largest number in a list. One possible algorithm is to iterate through the list and keep track of the largest number encountered so far. This algorithm has a time complexity of O(n), where n is the size of the list. This means that the algorithm's

Last active May 29, 2024 15:33

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

## Foundational Concepts

### Pre-Transformer Models

Created February 4, 2023 12:11
Token generation with jose
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 {SignJWT, jwtVerify, type JWTPayload} from 'jose'; export async function sign(payload: Token, secret: string): Promise { const iat = Math.floor(Date.now() / 1000); const exp = iat + 60* 60; // one hour return new SignJWT({...payload}) .setProtectedHeader({alg: 'HS256', typ: 'JWT'}) .setExpirationTime(exp) .setIssuedAt(iat)
Created September 2, 2022 17:56
Stable Diffusion prompt script
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 echo -n "Enter a prompt: " read prompt echo -n "Steps (default 10): " read steps if [[ -z "\$steps" ]]; then steps=10
Last active January 9, 2024 03:06
Script to Generate Flipper NFC "save" file encoded with URL
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
 Relocated to https://github.com/evilpete/flipper_toolbox """ Generates NFC with URL address data and outputs Flipper NFC "save" file this is a 5 min hack, No Guarantees python3 gen_url_nfc.py https://youtu.be/dQw4w9WgXcQ "Rick Roll". > rickroll.nfc requires ndeflib """
Last active April 29, 2024 02:25
Google Analytics 4 Proxy with Cloudflare Workers
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
 // 2023.4.23 更新，修复 gtag.js 加了个回车导致失效的问题 // 2023.3.2 更新，修复上报到 region*.google-analytics.com 未被代理的问题 addEventListener('fetch', (event) => { // 这里可以加 filter return event.respondWith(handleRequest(event)); }); // worker 应用的路由地址，末尾不加 '/' const DOMAIN = 'https://example.workers.dev/routerpath';
Created February 11, 2022 20:34
GitHub HTML Rendering Pipeline
`````````mermaid
sequenceDiagram
participant dotcom
participant iframe
participant viewscreen
dotcom->>iframe: loads html w/ iframe url
iframe->>viewscreen: request template
viewscreen->>iframe: html & javascript