Skip to content

Instantly share code, notes, and snippets.

View vielhuber's full-sized avatar
🍐
❹❷

David Vielhuber vielhuber

🍐
❹❷
View GitHub Profile
@vielhuber
vielhuber / .README.MD
Last active March 14, 2025 11:56
whatsapp js web api #js
  • node --version // >= 23
  • npm init -y
  • npm install whatsapp-web.js
  • npm install qrcode-terminal
  • node --no-deprecation script.js
@vielhuber
vielhuber / .htaccess
Last active March 3, 2025 13:02
echo immediately in browser #php
<IfModule mod_deflate.c>
SetEnv no-gzip 1
</IfModule>
@vielhuber
vielhuber / README.MD
Last active February 27, 2025 15:08
whatsapp web api baileys #ts #js

installation

  • echo "23.5.0" > ".nvmrc"
  • node --version && npm --version (at least node >=20 and npm >=9)
  • npm init -y
  • npm install baileys
  • npm install --save-dev tsx
import makeWASocket, { useMultiFileAuthState } from 'baileys';
@vielhuber
vielhuber / final.py
Last active March 2, 2025 18:55
build llm from scratch #python #ki
import tiktoken
import torch
import torch.nn as nn
import urllib.request
import re
from torch.utils.data import Dataset, DataLoader
import numpy as np
import zipfile
import os
from pathlib import Path
@vielhuber
vielhuber / README.MD
Created February 7, 2025 14:19
enums #php
  • Verfügbar ab PHP 8.1
  • Definition einer festen Menge von möglichen Werten für einen bestimmten Typ
  • Verbessert Code-Lesbarkeit
enum UserRole: string
{
    case Admin = 'admin';
    case Benutzer = 'user';
 case Gast = 'guest';
@vielhuber
vielhuber / README.MD
Last active January 13, 2025 13:34
openstreetmap osm generate and output tiles tilemaker maplibre #server #html #js
@vielhuber
vielhuber / index.html
Created January 6, 2025 08:43
input textarea auto capitalize uppercase
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8" />
<title>autocaps</title>
<script>
document.addEventListener('DOMContentLoaded', () => {
if( document.querySelectorAll('.autocaps').length > 0 ) {
document.querySelectorAll('.autocaps').forEach($el => {
$el.addEventListener('input', (e) => {
@vielhuber
vielhuber / .env
Last active December 26, 2024 09:17
puppeteer stagehand vodafone restart
VODAFONE_PASSWORD=...
OPENAI_API_KEY=...
@vielhuber
vielhuber / README.MD
Last active December 22, 2024 17:05
stagehand browser control with ai #js

installation

  • echo "23.5.0" > ".nvmrc"
  • node --version && npm --version (at least node >=20 and npm >=9)
  • npm install @browserbasehq/stagehand zod
  • npx playwright install-deps
  • npm exec playwright install
  • echo "OPENAI_API_KEY=sk-..." > .env

usage

@vielhuber
vielhuber / index.php
Created December 9, 2024 11:43
strftime deprecation #php
setlocale(LC_TIME, 'de_DE.utf8');
__strftime('%A, %d. %B %Y', strtotime('2001-01-01')); // Montag, 01. Januar 2001
IntlDateFormatter::formatObject(new DateTime('2001-01-01', new DateTimeZone('Europe/Berlin')), 'eeee, dd. MMMM yyyy', 'de_DE'); // Montag, 01. Januar 2001