Skip to content

Instantly share code, notes, and snippets.

View learosema's full-sized avatar
👋
Hello World!

Lea Rosema learosema

👋
Hello World!
View GitHub Profile
@selfawaresoup
selfawaresoup / twitter-no-doge.js
Created April 5, 2023 11:41
Twitter Userscript: No Doge
// ==UserScript==
// @name No Doge Twitter
// @match https://twitter.com/*
// @run-at document-start
// @grant GM.addStyle
// ==/UserScript==
let css = `
a[aria-label=Twitter] svg { display: none; }
div[aria-label=Loading…] { display: none; }
@EllyLoel
EllyLoel / reset.css
Last active April 13, 2024 18:14
CSS Reset
/*
Made by Elly Loel - https://ellyloel.com/
With inspiration from:
- Josh W Comeau - https://courses.joshwcomeau.com/css-for-js/treasure-trove/010-global-styles/
- Andy Bell - https://piccalil.li/blog/a-modern-css-reset/
- Adam Argyle - https://unpkg.com/open-props@1.3.16/normalize.min.css / https://codepen.io/argyleink/pen/KKvRORE
Notes:
- `:where()` is used to lower specificity for easy overriding.
*/
In einem kleinen Dorf wohnte einst ein Mädchen mit dem Namen Barbara.
Barbara war in der ganzen Gegend für Ihren ausgezeichneten Rhabarberkuchen bekannt.
Weil jeder so gerne Barbaras Rhabarberkuchen aß, nannte man sie Rhabarberbarbara.
Rhabarberbarbara merkte bald, dass sie mit ihrem Rhabarberkuchen Geld verdienen könnte.
Daher eröffnete sie eine Bar: Die Rhabarberbarbarabar.
float getBPMVis(float bpm){
// this function can be found graphed out here :https://www.desmos.com/calculator/rx86e6ymw7
float bps = 60./bpm; // beats per second
float bpmVis = tan((time*PI)/bps);
// multiply it by PI so that tan has a regular spike every 1 instead of PI
// divide by the beat per second so there are that many spikes per second
bpmVis = clamp(bpmVis,0.,10.);
// tan goes to infinity so lets clamp it at 10
bpmVis = abs(bpmVis)/20.;
export const h=(t,p,...c)=>({t,p,c,k:p&&p.key})
export const render=(e,d,t=d.t||(d.t={}),p,r,c,m,y)=>
// arrays
e.map?e.map((e,p)=>render(e,d,t.o&&t.o[p])):
// components
e.t.call?(e.i=render((render.c=e).t(Object.assign({children:e.c},e.p),e.s=t.s||{},t=>
render(Object.assign(e.s,t)&&e,d,e)),t.i||d,t&&t.i||{}),d.t=t=e):(
// create notes
m=t.d||(e.t?document.createElement(e.t):new Text(e.p)),
// diff props
@tomhicks
tomhicks / plink-plonk.js
Last active March 18, 2024 02:23
Listen to your web pages
@baetheus
baetheus / app.tsx
Last active December 12, 2022 19:13
Preact Hooks Experiment for Typescript
import { h, FunctionalComponent, render, options } from 'preact';
import { handleVnode } from './hooks';
// Wireup experimental hooks
options.vnode = handleVnode;
import Test from './component';
export const Main: FunctionalComponent<any> = () => (

Epub Tutorial

Pre-requisite

Creating eBooks in the EPUB format

Listing 1. Directory and file layout for a simple EPUB archive (EPUB 2 file structure )

@samthor
samthor / code.js
Last active July 18, 2022 11:02
Async cancellable promises
// nb. This code is available in an ES module of Promise helpers, here:
// https://github.com/samthor/promises
// symbol returned to indicate that a call was cancelled
export const takeoverSymbol = Symbol('takeover');
/**
* Accepts a generator function, which yields Promises, and converts it to an async function
* that cancels any previous calls.
*/
library(magick)
library(reshape2)
library(dplyr)
library(tidygraph)
library(particles)
library(animation)
plot_fun <- function(sim) {
df <- as_tibble(sim)
plot(df$x, df$y, col = df$color, pch = '.', axes = FALSE, xlim = c(-100, 317), ylim = c(-268, 100), xlab = NA, ylab = NA)