Listing 1. Directory and file layout for a simple EPUB archive (EPUB 2 file structure )
// ==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; } |
/* | |
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 |
/* | |
Copy this into the console of any web page that is interactive and doesn't | |
do hard reloads. You will hear your DOM changes as different pitches of | |
audio. | |
I have found this interesting for debugging, but also fun to hear web pages | |
render like UIs do in movies. | |
*/ | |
const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |
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> = () => ( |
// 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) |