Skip to content

Instantly share code, notes, and snippets.

View bergie's full-sized avatar

Henri Bergius bergie

View GitHub Profile
@bergie
bergie / Energy-2023.ipynb
Last active November 1, 2023 09:27
Lille Ø 2023 Energy Mix
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bergie
bergie / 2023 polars.ipynb
Last active April 5, 2024 03:11
2023 polars.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bergie
bergie / 2022 polars.ipynb
Last active December 8, 2022 21:16
Lille Oe Polars
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bergie
bergie / windvswater.ipynb
Last active November 1, 2023 08:06
Wind vs water
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bergie
bergie / rename.js
Created November 18, 2022 11:17
Rename notes from GitJournal Zettelkasten to Obsidian
const { readdir, readFile, writeFile } = require('node:fs/promises');
const { spawn } = require('node:child_process');
const path = require('path');
const frontmatter = require('frontmatter');
let notedir = process.env.PWD;
if (process.argv.length > 2) {
notedir = path.resolve(process.env.PWD, process.argv[2]);
}
const notesmap = {};
@bergie
bergie / get_events.py
Created March 3, 2020 13:41
Get click/doubleclick from Bluetooth shutter button
import asyncio
import threading
from evdev import InputDevice, categorize, ecodes
dev = InputDevice('/dev/input/event1')
clicks = 0
timer = None
def count_clicks():
global clicks, timer
@bergie
bergie / unused.js
Created March 27, 2018 10:11
Find unused components and modules in a FBP project
const fbpManifest = require('fbp-manifest');
const fbpGraph = require('fbp-graph');
const path = require('path');
const showError = (err) => {
console.error(err);
process.exit(1);
};
const baseDir = process.cwd();
@bergie
bergie / FlowhubStats.js
Last active February 23, 2018 16:24
NoFlo asComponent
const noflo = require('noflo');
function getFlowhubStats() {
return fetch('https://api.flowhub.io/stats')
.then((result) => result.json());
}
exports.getComponent = () => noflo.asComponent(getFlowhubStats);
@bergie
bergie / Bsync.coffee
Created February 15, 2018 11:16
Bsync.coffee
noflo = require 'noflo'
window.bsyncs = []
class Bsync
constructor: (@request,@waitfor,@block,@callback) ->
exports.getComponent = ->
c = new noflo.Component
c.description = 'bsync'
@bergie
bergie / noflo.json
Created October 24, 2017 08:50 — forked from forresto/noflo.json
Delaunay masks
{
"properties": {
"name": "face",
"environment": {
"type": "noflo-browser",
"content": "<video id=\"vid\" width=\"640\" height=\"480\" style=\"position:absolute; top:0px; left:0px\" autoplay></video>\n<canvas id=\"can\" width=\"640\" height=\"480\" style=\"position:absolute; top:0px; left:0px\"></canvas>\n<div id=\"start\" style=\"position:absolute; top:0px; left:0px;\"><button id=\"start\">start camera</button><br/>\ncolor start <input id=\"colorstart\" type=\"range\" min=\"0\" max=\"360\" value=\"0\"></input><br/>\ncolor end<input id=\"colorend\" type=\"range\" min=\"0\" max=\"360\" value=\"360\"></input><br />\ncolor count<input id=\"colorcount\" type=\"range\" min=\"1\" max=\"100\" value=\"50\"></input><br/>\n"
}
},
"inports": {},
"outports": {},