Skip to content

Instantly share code, notes, and snippets.

@marc-harry
marc-harry / export-notebook-definition.sql
Created September 27, 2025 16:19 — forked from mrjsj/export-notebook-definition.sql
The DuckDB UI stores notebook content in an internal database called _duckdb_ui. You can query and export notebook content, as well as insert new definitions into the database. Warning: Modifying the internal database may lead to corruption and data loss. Be cautious and use it at your own risk!
copy (
select
"json"
from _duckdb_ui.notebook_versions
where 1=1
and title = 'MySingleNotebook'
and expires is null
) to 'exported-notebook.json';
@marc-harry
marc-harry / iBeaconCalculateDistance.js
Created June 9, 2017 14:59 — forked from JoostKiens/iBeaconCalculateDistance.js
iBeacon calculate distance in meters
// Based on http://stackoverflow.com/a/20434019
function calculateAccuracy(txPower, rssi) {
if (rssi === 0) {
return -1; // if we cannot determine accuracy, return -1.
}
var ratio = rssi * 1 / txPower;
if (ratio < 1.0) {
return Math.pow(ratio, 10);
module.exports = {
/**
*
* Using raw socket.io functionality from a Sails.js controller
*
*/
index: function (req,res) {