Skip to content

Instantly share code, notes, and snippets.

@robclewley
robclewley / clapper.ipynb
Created August 19, 2018 19:08
Some pyaudio resources
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@udondan
udondan / Example: golang gorm postgres uuid relation.md
Last active December 20, 2024 13:25
Example: golang gorm postgres uuid relation

Example: golang gorm postgres uuid relation

I was trying forever to get autoloading relationships working with postgres 9.4 and gorm and primary keys of type uuid.

Many tutorials and examples, even those on the official docs were just not workiong or missing important details.

The program in this gist creates the table structure and inserts a nested record. A parent and a child object is created by simply creating the child, which holds the relation to a parent. The child element then is queried by ID. The returned object holds the nested parent object.

Used package versions:

@cameronblandford
cameronblandford / knexPostgresFullTextSearch.js
Last active November 8, 2023 07:35
Implement full text search using Knex + Objection
// Because we're using an ORM (Objection), it's a pain to add a tsvector when inserting,
// since tsvectors and FTS aren't supported by Objection. Instead, I've added a hook that
// fires on insert which auto-generates the tsvector field for each newly inserted entry.
// This is an example knex migration file for said behavior.
const addUserIndex = `
ALTER TABLE public.user ADD "document" tsvector;
CREATE FUNCTION my_trigger_function()
RETURNS trigger AS $$
### Flatpak Repos
List packages on a repo :
flatpak remote-ls repon-name --user
flatpak remote-ls
Install packages :
flatpak --user install repo-name package-name io.liri.Platform
Flathub:
@alexishida
alexishida / nginx-config-auth-cert-ssl.md
Last active November 26, 2024 15:48
Tutorial to configure Nginx client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Original: https://gist.github.com/mtigas/952344

Convert SSL certificate from CRT format to PEM

openssl x509 -in server.crt -out server.der -outform DER
openssl x509 -in server.der -inform DER -out server.pem -outform PEM
@slightfoot
slightfoot / bottom_sheet.dart
Last active February 1, 2024 18:24
Modal Bottom Sheet with Input Fields fix for Flutter (Fix issue with overlap with keyboard and fix for tapping to dismiss)
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
@gornostal
gornostal / README.md
Last active April 16, 2025 20:06
Ulauncher Color Themes

This will be a temporary site for sharing Ulauncher color themes

When posting a theme make sure it has

  • title (theme name or whatever)
  • link to a gist or github repo with theme files
  • screenshot attached (just drag an image onto a comment area)

import 'dart:math' as math;
import 'dart:math';
import 'package:flutter/foundation.dart';
import 'package:color/color.dart';
import 'dart:ui' as ui;
Map<String, ColorDefinition> _kColorDictionary = {
Hue.monochrome.name:
const ColorDefinition(hue: Hue.monochrome, lowerBounds: const [
@justsml
justsml / fetch-api-examples.md
Last active April 5, 2025 13:18
JavaScript Fetch API Examples
@gaborvecsei
gaborvecsei / install_opencv_raspberry_pi_3b.sh
Last active January 24, 2023 19:52
Install OpenCV easily on your Raspberry Pi 3 B
mkdir opencv
cd opencv
sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt-get install build-essential cmake pkg-config -y
sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev -y
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev -y
sudo apt-get install libxvidcore-dev libx264-dev -y
sudo apt-get install libgtk2.0-dev libgtk-3-dev -y
sudo apt-get install libatlas-base-dev gfortran -y