Skip to content

Instantly share code, notes, and snippets.

@boulabiar
boulabiar / simple.md
Last active December 13, 2020 00:21
inkscape Dbus

Using systemd dbus

create an ellipse

busctl --user call org.inkscape /org/inkscape/document_0 org.inkscape.document ellipse iiii 0 0 20 40

get list of objects in layer1

busctl --user call org.inkscape /org/inkscape/document_0 org.inkscape.document get_children "s" layer1

@boulabiar
boulabiar / focus.c
Created July 1, 2020 20:59
Get the FocusIn FocusOut events from xcb
// sources:
// https://xcb.freedesktop.org/tutorial/events/
// https://xcb.freedesktop.org/manual/group__XCB____API.html
// https://github.com/wmutils/opt/blob/master/wew.c
//
// compile with:
// gcc focus.c -lxcb
#include <stdlib.h>
#include <stdio.h>
cmake_minimum_required(VERSION 3.5)
set(CMAKE_CXX_STANDARD 11)
project(demo LANGUAGES CXX)
SET("OpenCV_DIR" "...../opencv4/opencv")
find_package( OpenCV REQUIRED )
MESSAGE(STATUS "Include dirs ${OpenCV_INCLUDE_DIRS}")
MESSAGE(STATUS "LINK LIBRARIES ${OpenCV_LIBS}")
find_package(al-runtime)
# view the desktop into a window on Linux
gst-launch-1.0 ximagesrc startx=1920 use-damage=0 \
! video/x-raw,framerate=30/1 \
! videoscale method=0 \
! video/x-raw,width=1920,height=1080 \
! ximagesink
# view the desktop into a window on MacOS
gst-launch-1.0 avfvideosrc capture-screen=true \
@boulabiar
boulabiar / GLSL-Noise.md
Created February 27, 2017 11:08 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
	return mix(rand(fl), rand(fl + 1.0), fc);
}

Keolis "open-data" : XML Realtime API

Les données retournées sont au format XML.

Document trouvé et modifié depuis Pastebin.

Récupérer la liste des lignes

var casper = require('casper').create();
casper.start('http://www.bibus.fr/horaires-station-navitia.aspx', function() {
this.echo(this.getTitle());
});
casper.run();
// fill form
casper.then(function(){