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 / gitting_around.md
Last active July 24, 2020 18:35 — forked from myusuf3/delete_git_submodule.md
Some git snippets

Gitting around

To clone a repo with all its submodules:

  • git clone --recursive [git://url]

Add a submodule

  • git submodule add [git://url] [path/to/submodule]

Load submodules if they weren’t when cloning

  • git submodule update --init

php -S localhost:8000 kirby/router.php

@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
@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: {

Validation

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

@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;
@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 / 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 / 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() {
## Year validation YYYY 1800 until now
^(18|19|20)\d{2}$
## Pseudo URL validation
^https?:\/\/