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 / net-communicator.go
Last active May 2, 2018 13:39
golang basic tcp communication
package main
import (
"flag"
"fmt"
"io/ioutil"
"net"
"os"
)
@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);
@marc-harry
marc-harry / Docker Volume commands
Last active May 11, 2016 09:44
List of docker commands for use with volumes
// Create Volume
docker create -v /var/lib/postgresql/data --name pgres2 busybox
// Remove Volume
docker rm pgres2
// List files in volume directory
docker run --rm --volumes-from pgres2 busybox ls -lh /var
// Make backup
@marc-harry
marc-harry / PythonSample.py
Created September 11, 2015 08:02
Base Python Samples
class Greeting:
def __init__(self):
self.subName = 'SubName'
self.attr = []
def subMethod(self):
return 'SubMethod'
class Hello(Greeting):
name = ''
module.exports = {
/**
*
* Using raw socket.io functionality from a Sails.js controller
*
*/
index: function (req,res) {