Skip to content

Instantly share code, notes, and snippets.

View schafeld's full-sized avatar
🏗️
Building Open Source CRUD apps in React and Vue...

Oliver Schafeld schafeld

🏗️
Building Open Source CRUD apps in React and Vue...
View GitHub Profile
@schafeld
schafeld / flux-generative-ai-image-enhancement.md
Created September 16, 2025 11:18
Generative AI Image Enhancement (Flux, BFL, CURL)

Curl Flux Image Enhancement Example

Enhance a photo by sending its Base 64 encoded image data to Black Forest Lab's Flux API. Retrieve an enhanced image according to prompted specifications.

Template / Documentation

See Black Forest Labs docs for more details.

Code Example

@schafeld
schafeld / Readme.md
Last active May 21, 2025 20:04
Custom Web Components

Custom Web Components

Preview

View in jsPad

Description

Just the two kinds of web components.

@schafeld
schafeld / index.html
Last active November 22, 2024 13:30
React Boilerplate (React 18+)
<div id="app"></div>
@schafeld
schafeld / index.html
Created November 13, 2024 13:57
Vue without Build Step
<!--
Code lifted from:
https://github.com/MicrosoftDocs/mslearn-vue-dynamic-render/blob/main/end/index.html
Course:
https://learn.microsoft.com/en-us/training/modules/vue-dynamic-rendering/3-render-lists-exercise
-->
@schafeld
schafeld / index.html
Last active November 5, 2024 12:05
React Boilerplate – Quickly test React component code in CodePen – https://codepen.io/schafeld/pen/BaXOLXj?editors=1111
<div id="app"></div>
<!--
In JS window use dependencies:
https://unpkg.com/react@18/umd/react.development.js
https://unpkg.com/react-dom@18/umd/react-dom.development.js
Use Babel precompiler.
-->
@schafeld
schafeld / remove-imgs.js
Created August 21, 2023 08:47
Remove all images from web page
removeAllImgsFilter = function(node){
if (node.tagName=="IMG") //filter out all IMG elements
return NodeFilter.FILTER_ACCEPT;
else
return NodeFilter.FILTER_SKIP;
}
var walker = document.createTreeWalker(document.body, NodeFilter.SHOW_ELEMENT, removeAllImgsFilter, false);
while (walker.nextNode())
@schafeld
schafeld / javascript-scratchboard.md
Last active March 29, 2021 09:45
Scratchboard Javascript methods

Javascript Scratchboard

Array

Concatenate array

[1,4,67,34,677].reduce((accumulator, current) => accumulator + current, []);

"146734677"
@schafeld
schafeld / bulk-delete-twitter-likes.md
Created March 20, 2021 16:59
Bulk delete Twitter likes

How to delete many Twitter Likes at a time

Simply go in your (Chrome) browser to the Likes-page, e.g. https://twitter.com/{your user handle}/likesand open the DevTools console (CMD OPT i on a Mac). Paste the following code into the console:

document.querySelectorAll("[data-testid='unlike']").forEach( el => el.click() );

This will click all heart icons on that page, in effect unliking all visible Likes. Scroll down and repeat as many times as needed.

@schafeld
schafeld / Java8_GCP_Debian_VM.MD
Last active January 25, 2022 00:02
Setting Up a Java 8 Development Environment in Google Cloud Platform (Debian, VM)

GCP Qwiklabs – Setting Up an (outdated) Java Development Environment on GCP

Problem: The course instructions use an outdated Java 8 version. The simple server for the quiz would not compile in Java 11.

It was tricky to set up an outdated Java version. So here are updated instructions to pass the checkpoints (this is well within the Coursera student honor code as it is just an update of the official instructions).

Part of a Coursera MOOC on Google Cloud Platform

Qwiklabs – Setting Up a Development Environment: Java

@schafeld
schafeld / vim_cheatsheet.md
Created August 14, 2019 17:27 — forked from awidegreen/vim_cheatsheet.md
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close