Skip to content

Instantly share code, notes, and snippets.

@aoloe
aoloe / webrtc-editor.md
Last active March 19, 2023 06:41
webrtc collaborative document editing

specification:

  • php server storing a server.
  • the first person opening a file becomes the master and is in charge to save to the server
  • all other users open webrtc connection to the master and keep the document in sync with him
  • if it makes things easier, only allow one user at a time to edit a block (paragraph, list, section)

todo:

  • check if and how to get webrtc to work without a node server.
  • try to convert a chat example in a text editor.
<?php
/**
* Show the history of the latest selected tables. Cookies based.
* Set the js variable history_length to define the history length.
* Works only with current browsers.
* @link http://www.adminer.org/plugins/#use
* @author Ale Rimoldi, http://www.ideale.ch/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
@aoloe
aoloe / labadoo-scratch.md
Last active January 3, 2020 10:49
game ideas for the labadoo scratch day

scratch cards for the labadoo day

on top of using

we could create sets of cards specific to the creation of a few games or make sure that a card exist for each step of the game.

  • pong
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises
// https://scotch.io/tutorials/javascript-promises-for-dummies
// https://www.youtube.com/watch?v=s6SH72uAn3Q
// 1.
// doSomething(function(result) {
// doSomethingElse(result, function(newResult) {
// doThirdThing(newResult, function(finalResult) {
@aoloe
aoloe / scribus-add-plugin-windws-alpha.md
Last active February 22, 2019 14:28
instructions by aiena for compiling scribus on windows

Adding a plugin to the the Visual Studio project

  • In Visual Studio create a GUID of type registry with Tools > Create GUID

  • in win32/msvc2015/Scribus.sln add after the last plugin (Project):

Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pluginname", "pluginname\pluginname.vcxproj", "{GUID-GENERATED-BY-VISUAL-STUDIO}"
    ProjectSection(ProjectDependencies) = postProject
        {B17FCD80-7978-4544-93C4-2FE1AC6FE9F3} = {B17FCD80-7978-4544-93C4-2FE1AC6FE9F3}
@aoloe
aoloe / collide.py
Last active November 8, 2018 16:32
WIDTH = 640
HEIGHT = 480
BLACK = (0, 0, 0)
RED = (120, 0, 0)
box = Rect((100, 100), (100, 100), anchor=('left', 'top'))
player = Rect((300, 100), (100, 100), anchor=('left', 'top'))
def update(dt):
#include <iostream>
#include <string>
#include <cassert>
std::string get_alter_typ(int alter)
{
std::string typ{}; // typ definiert
if (alter < 18) // alter vergleichen
{
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/python3.6
import os
import sys
import argparse
import re
from subprocess import call
parser = argparse.ArgumentParser(description='Convert a svn referenced in a markdown line into png.')
parser.add_argument('lines', nargs='?', type=argparse.FileType('r'), default=sys.stdin)
@aoloe
aoloe / README.md
Last active July 10, 2018 09:52
Python classes for exercising the adapter pattern

Adapter pattern with Python: the music player

Without modifying:

  • the Media_player_audio and Media_player_video interfaces
  • nor the Media_player_mp4 class

add an adapter that allows the music player to play the sound of an mp4 file.