Skip to content

Instantly share code, notes, and snippets.

View moritzebeling's full-sized avatar
🌍
Home on earth

moritzebeling moritzebeling

🌍
Home on earth
View GitHub Profile
@moritzebeling
moritzebeling / Player.svelte
Last active December 31, 2021 17:14
Vimeo Svelte Player
<script context="module">
const allPlayers = new Set();
</script>
<script>
import Player from "@vimeo/player";
import Progress from "./Progress.svelte";
import { onDestroy } from "svelte";
import { renderTime, renderPercent, errorHandler } from "./helpers.js";
@moritzebeling
moritzebeling / mixcloud-player.html
Last active March 13, 2021 22:47
Mixcloud Widget API Custom Player
<script src="//widget.mixcloud.com/media/js/widgetApi.js" type="text/javascript"></script>
<iframe width="100%" height="60" src="https://www.mixcloud.com/widget/iframe/?hide_cover=1&mini=1&light=1&hide_artwork=1&autoplay=1&feed=%2Fradioraheem_milano%2Fblack-sugar-puntata-01%2F" frameborder="0" allow="autoplay"></iframe>
<div class="controls">
<button id="play">Play</button>
<button id="pause">Pause</button>
<button id="next">Next</button>
<button id="load0">Load Track 1</button>
<button id="load1">Load Track 2</button>
## Year validation YYYY 1800 until now
^(18|19|20)\d{2}$
## Pseudo URL validation
^https?:\/\/
@moritzebeling
moritzebeling / random-line.p5js
Created February 16, 2020 13:56
Place random line on cnavas
function randomPoint() {
return {
x: round(random(0, width / 20)) * 20,
y: round(random(0, height / 20)) * 20
};
}
let rule = {
lines: [],
reinvent: function() {
@moritzebeling
moritzebeling / random-composition-1.p5js
Created February 16, 2020 13:55
Place a random Circle and Rectangle on canvas
function random255(){
return round(random(0,16)) * 16;
}
function randomColor() {
return {
r: random255(),
g: random255(),
b: random255()
};
@moritzebeling
moritzebeling / atw-logo.js
Last active January 12, 2020 16:27
p5-atw-logo
let board = {
x: 10,
y: 10,
w: 10,
h: 10,
min: {x: 60, y: 40},
max: 30,
area: function( x , y ){
this.x = max( this.max, min( (width/2) -(this.min.x/2), min( x, width-x ) ) );
@moritzebeling
moritzebeling / p5-blinking-cell.js
Created January 8, 2020 23:07
p5 blinking cell
class Cell {
constructor( x, y, on = true ){
this.x = x;
this.y = y;
this.on = on;
if( this.on === false ){
this.radius = 0;
} else {
this.radius = maxRadius;

Validation

^(([A-Fa-f\d]){3}){1,2}$

@moritzebeling
moritzebeling / p5js-pong.js
Last active February 11, 2024 13:12
p5.js Pong
/**
* requires p5.js
* try out at https://editor.p5js.org
*/
let ball = {
x: 300,
y: 150,
radius: 10,
speed: {
@moritzebeling
moritzebeling / htaccess cheat sheet
Last active February 9, 2020 17:35
htaccess boilerplate
### charset
AddDefaultCharset UTF-8
### directory index
DirectoryIndex index.html
### avoid directory listing
Options -Indexes
### default language