Skip to content

Instantly share code, notes, and snippets.

@aoloe
aoloe / 3columnA4.py
Created September 17, 2015 09:34
fixing scribus/scribus/plugins/scriptplugin/samples/3columnA4.py
# -*- coding: utf-8 -*-
"""
Creates 3 column layout on A4 paper and save it under 3columnA4.sla filename.
This is a simple way to demonstrate creating a doc on the fly.
"""
try:
# Please do not use 'from scribus import *' . If you must use a 'from import',
# Do so _after_ the 'import scribus' and only import the names you need, such
@aoloe
aoloe / ex14_vector.cpp
Created September 22, 2015 20:32
exercise 19, chapter 4, programming c++
// type names and scores
#include "std_lib_facilities.h"
int main(){
vector<string> names;
vector<int> scores;
string name;
int score;
@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.
@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
@aoloe
aoloe / composer.json
Created November 13, 2015 14:47
mustache with partials and associative arrays
{
"name": "aoloe/mustache-test",
"require" : {
"mustache/mustache" : "~2.5"
}
}
#!/usr/bin/python3
import os
import sys
import datetime
import argparse
import yaml
import json
import subprocess
import tempfile
@aoloe
aoloe / CMakeLists.txt
Last active March 21, 2018 15:42
cycle and reverse for scribus
CMAKE_MINIMUM_REQUIRED(VERSION 3.4)
PROJECT(cycle-and-reverse)
SET(CMAKE_CXX_STANDARD 14)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
@aoloe
aoloe / CMakeLists.txt
Last active March 21, 2018 14:40
Refactoring AObjects
CMAKE_MINIMUM_REQUIRED(VERSION 3.4)
PROJECT(align-objects)
SET(CMAKE_CXX_STANDARD 14)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
@aoloe
aoloe / main.py
Created May 7, 2018 12:39
Python: Find the distance between points
#!/usr/bin/env python3
import math
from itertools import accumulate
from functools import reduce
points = [(1,2), (2,1), (5,3)]
# points = [[1,2], [2,1], [5,3]]
print(points)

Lists sum problem

You are given two lists a and b with integers, that also can be negative, and a target sum.

Task:

  • find a function that returns true if two numbers in the list can be added to build the target sum.