Skip to content

Instantly share code, notes, and snippets.

View kartben's full-sized avatar

Benjamin Cabé kartben

View GitHub Profile
cwebp ~/Downloads/nrf54l15dk_nrf54l15.jpg -o out.webp -q 65
@kartben
kartben / gist:c59e9e0b4e89f784b3ecd3cde92c21ae
Last active November 30, 2023 12:23
Zephyr latency_measures
M5Stack AtomS3 @240MHz
*** Booting Zephyr OS build zephyr-v3.5.0-2395-gc8f4455ef8f9 ***
Preemptive threads ctx switch via k_yield (K -> K) : 579 cycles , 2412 ns :
Cooperative threads ctx switch via k_yield (K -> K) : 568 cycles , 2370 ns :
Switch from ISR back to interrupted thread : 148 cycles , 620 ns :
Switch from ISR to another thread (kernel) : 304 cycles , 1270 ns :
Create kernel thread from kernel thread : 215 cycles , 896 ns :
Start kernel thread from kernel thread : 573 cycles , 2391 ns :
Suspend kernel thread from kernel thread : 681 cycles , 2841 ns :
@kartben
kartben / misc
Last active September 21, 2023 13:22
lorem ipsum
Finished [Fuzzing]
Finished [CII-Best-Practices]
Finished [Dangerous-Workflow]
Finished [Token-Permissions]
Finished [CI-Tests]
Finished [SAST]
Finished [Pinned-Dependencies]
Finished [Vulnerabilities]
Finished [Code-Review]
Finished [Branch-Protection]
@subscription-key = REPLACE_WITH_YOUR_AZURE_MAPS_KEY
@SeattleWA = 47.60323,-122.33028
@RedmondWA = 47.67491,-122.124
###
# GetTimezoneByCoordinates for Seattle WA
###
GET https://atlas.microsoft.com/timezone/byCoordinates/json?subscription-key={{subscription-key}}&api-version=1.0&options=all&query={{SeattleWA}}
###
@kartben
kartben / gist:350a9b72374e44c8ab60abaaef7c1acd
Last active July 4, 2019 15:00
list of famous paintings + thumbnails
SELECT ?item ?itemLabel ?thumb ?catcode WHERE { ?item p:P528 [ pq:P972 wd:Q41634361 ; ps:P528 ?catcode].
?item wdt:P18 ?picture .
BIND(REPLACE(wikibase:decodeUri(STR(?picture)), "http://commons.wikimedia.org/wiki/Special:FilePath/", "") as ?fileName) .
BIND(REPLACE(?fileName, " ", "_") as ?safeFileName)
BIND(MD5(?safeFileName) as ?fileNameMD5) .
BIND(CONCAT("https://upload.wikimedia.org/wikipedia/commons/thumb/", SUBSTR(?fileNameMD5, 1, 1), "/", SUBSTR(?fileNameMD5, 1, 2), "/", ?safeFileName, "/650px-", ?safeFileName) as ?thumb)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY xsd:integer(?catcode)
find . -type d -depth 1 -exec sh -c "git --git-dir={}/.git --work-tree=$PWD/{} log --since '1 year ago' --until 'yesterday' --format='%aN' | sort -uf" \; | sort -uf
# 1 year ago
find . -type d -depth 1 -exec sh -c "git --git-dir={}/.git --work-tree=$PWD/{} log --since '2 years ago' --until '1 year ago' --format='%aN' | sort -uf" \; | sort -uf
@kartben
kartben / che.sh
Last active March 30, 2016 06:07
#!/bin/bash
sudo apt-get update
sudo apt-get -y install --no-install-recommends \
openssh-server \
sudo \
procps \
wget \
unzip \
@kartben
kartben / mqtt_spark_streaming.py
Last active October 7, 2023 16:16
Example of how to use Spark Streaming for MQTT data consolidation
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
var YouTube = require('../lib/youtube');
var config = require('./config');
var fs = require('fs');
var youTube = new YouTube();
youTube.setKey(config.key);
youTube.getPlayListsItemsById('PLy7t4z5SYNaQS1XZ8uiqqn0nNLi4qU-VW', function(error, result) {