Skip to content

Instantly share code, notes, and snippets.

@fabrixxm
fabrixxm / json_generated_columns.sql
Last active August 7, 2022 08:00 — forked from AlessandroLorenzi/json_generated_columns.sql
Testing json generated columns
DROP TABLE activities;
CREATE TABLE activities (
id INTEGER NOT NULL PRIMARY KEY,
activity TEXT NOT NULL,
type TEXT GENERATED ALWAYS AS (json_extract(activity, '$.type')) STORED,
name text GENERATED ALWAYS AS (json_extract(activity, '$.name')) STORED
);
INSERT INTO
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
<title>Skulls with Rough.js</title>
<meta name="description" content="Random squares generative art using rough.js">
<style>
body {
margin: 0;
@fabrixxm
fabrixxm / climatik.py
Last active May 19, 2017 10:39
Create command line interface from function definition
"""
climatik v0.0.1
Create command line interface from function definition
"""
import inspect
import argparse
def command(fnc, *args, **kwargs):
@fabrixxm
fabrixxm / gasyncspawn.py
Last active May 17, 2023 07:30
Run external process asynchronously with Python, GLib. Get stdout and stderr via signals.
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#https://developer.gnome.org/pygobject/2.28/
#http://www.pygtk.org/articles/subclassing-gobject/sub-classing-gobject-in-python.htm#d0e570
from gi.repository import GObject
from gi.repository import GLib
class GAsyncSpawn(GObject.GObject):
#!/usr/bin/python
import sys
import StringIO
import hashlib
from optparse import OptionParser
from xml.dom import minidom
from xml.dom.minidom import Node
first = True
@fabrixxm
fabrixxm / globalkeys.py
Created July 17, 2012 15:15
Windows global hotkeys in a thread
# After "Tim Golden's Python Stuff" code
# http://timgolden.me.uk/python/win32_how_do_i/catch_system_wide_hotkeys.html
#
# After a post to c.l.py by Richie Hindle:
# http://groups.google.com/groups?th=80e876b88fabf6c9
#
import os
import sys
import threading
@fabrixxm
fabrixxm / gallery.php
Created April 17, 2012 15:16
Friendica themes gallery