Skip to content

Instantly share code, notes, and snippets.

View wzulfikar's full-sized avatar
💭
Set status

Wildan Zulfikar wzulfikar

💭
Set status
View GitHub Profile
@VikParuchuri
VikParuchuri / algo.md
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

@veekaybee
veekaybee / normcore-llm.md
Last active March 28, 2024 09:10
Normcore LLM Reads

Anti-hype LLM reading list

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

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@LunaticMuch
LunaticMuch / userjwtJose.js
Created February 4, 2023 12:11
Token generation with jose
import {SignJWT, jwtVerify, type JWTPayload} from 'jose';
export async function sign(payload: Token, secret: string): Promise<string> {
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)
@breadthe
breadthe / sd.sh
Created September 2, 2022 17:56
Stable Diffusion prompt script
#!/bin/bash
echo -n "Enter a prompt: "
read prompt
echo -n "Steps (default 10): "
read steps
if [[ -z "$steps" ]]; then
steps=10
@evilpete
evilpete / gen_url_nfc.py
Last active January 9, 2024 03:06
Script to Generate Flipper NFC "save" file encoded with URL
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
"""
@xiaopc
xiaopc / gaWorker.js
Last active October 25, 2023 14:50
Google Analytics 4 Proxy with Cloudflare Workers
// 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';
@martinwoodward
martinwoodward / mermaid.md
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
 iframe-&gt;&gt;dotcom: iframe ready
@MrChocolatine
MrChocolatine / TS - More precise return type method Date#toISOString.d.ts
Last active February 22, 2024 22:06
TypeScript – How to accurately type dates in ISO 8601 format
// In TS, interfaces are "open" and can be extended
interface Date {
/**
* Give a more precise return type to the method `toISOString()`:
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
*/
toISOString(): TDateISO;
}
type TYear = `${number}${number}${number}${number}`;
###################
# STAGE 1: builder
###################
FROM --platform=linux/amd64 eclipse-temurin:11.0.12_7-jdk-focal as builder
ARG MB_EDITION=oss CI=true
WORKDIR /app/
@izuolan
izuolan / worker.js
Last active July 6, 2023 15:15
Custom domain for your Craft.do pages. Demo: https://next-craft.vercel.app and Tutorial: https://zuolan.me/en/next_craft_en
// Your domain name
const MY_DOMAIN = 'note.example.com'
// Website language
const LANG = 'en'
// Favicon url
const FAVICON_URL = 'https://example.com/favicon.ico'
// Your config page link