Skip to content

Instantly share code, notes, and snippets.

View schafeld's full-sized avatar
🏗️
Playing with LLMs, busy chatbot-building...

Oliver Schafeld schafeld

🏗️
Playing with LLMs, busy chatbot-building...
View GitHub Profile
@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
@schafeld
schafeld / PY0101EN-1-1-Types.ipynb
Last active April 25, 2019 18:01
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@schafeld
schafeld / index.html
Last active September 15, 2018 11:40
Week of the year (Kalenderwoche)
<h1>Week of the year: <span id="weekNumber"> <button onClick="setNum()">click to show</button> </span></h1>