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 / 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>
@schafeld
schafeld / index.html
Created February 24, 2018 09:00
Typography Schafeld.com HP
<div class="container">
<div id="logo">
<svg id="Ebene_1" data-name="Ebene 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 294.78 105.6" copyright="Oliver Schafeld, info@schafeld.com">
<defs>
<style>
.cls-12{letter-spacing:0}
</style>
<linearGradient id="Unbenannter_Verlauf_8" data-name="Unbenannter Verlauf 8" x1="-1.63" y1="83.58" x2="35.13" y2="70.2" gradientUnits="userSpaceOnUse">
<stop offset=".16" stop-color="#b4e1fa"/>
<stop offset=".59" stop-color="#4ac0e5"/>
@schafeld
schafeld / index.html
Last active October 7, 2017 09:31
Snappy Slider
<div class="demo">
<p>
<label for="amount">Volume:</label>
<input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" />
</p>
<div id="slider-horizontal"></div>
</div>
@schafeld
schafeld / index.html
Created August 15, 2017 13:23
Speed Dials -- SVG pointer rotation controlled by CSS (4)
<svg xmlns="http://www.w3.org/2000/svg"
width="236"
height="244"
viewBox="0 0 236 244"
class="gauge first rotate-five-percent">
<g fill="none" fill-rule="evenodd">
<g fill-rule="nonzero">
<path fill="#FFF" d="M183.7 98.67c-.02-.11-.055-.217-.1-.32-.024-.048-.05-.095-.08-.14-3.18-7.603-7.767-14.538-13.52-20.44-.05-.13-.15-.235-.28-.29-12.24-12.43-28.956-19.427-46.4-19.42h-.64c-8.573.073-17.046 1.844-24.93 5.21l-.2.06c-.088.04-.17.085-.25.14-7.613 3.333-14.523 8.084-20.36 14-.134.056-.238.165-.29.3-5.66 5.782-10.2 12.563-13.39 20l-.05.09c-.05.102-.086.21-.11.32-3.322 7.968-5.022 16.518-5 25.15-.078 17.31 6.766 33.933 19.01 46.17.29.273.672.43 1.07.44.4-.003.78-.165 1.06-.45l9-9.15c.397-.378.556-.942.415-1.472-.14-.53-.56-.94-1.09-1.07-.533-.132-1.095.038-1.465.442l-7.88 8c-4.874-5.102-8.844-10.996-11.74-17.43l10.1-4.81c.748-.356 1.066-1.252.71-2-.356-.748-1.252-1.066-2-.71l-10 4.8c-2.668-6.787-4.12-13.99-4.29-21.28l11.31-.25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5l-11.31.25c