Skip to content

Instantly share code, notes, and snippets.

View tomquas's full-sized avatar

tom quas tomquas

  • patugo GmbH
  • munich, germany
View GitHub Profile
@staab
staab / survey.md
Last active April 27, 2024 05:04
A survey of Nostr DM proposals

This is an attempt to take a step back and summarize all proposed approaches to private messages (DMs, group chats, and general-purpose nostr-within nostr, including for large groups of people) for the purpose of building a secure, feature-complete, interoperable solution.

This topic has come up repeatedly over nostr's history, and has entered the limelight again because of HRF's e2e encrypted group chats bounty. The hope here is to get everyone on the same page and hammer out one or more NIPs that can incorporate the best parts of all proposed solutions so we can finally get secure messaging on nostr.

Please comment with thoughts, criticisms, missing proposals/implmentations, and I will update the gist as we go along.

Proposals Reference

@PlugFox
PlugFox / main.dart
Last active January 5, 2024 14:27
Performance benchmark of different ways to append data to a list in dart, BytesBuilder vs AddAll vs Spread vs Concatenation
// ignore_for_file: curly_braces_in_flow_control_structures
/*
* Performance benchmark of different ways to append data to a list.
* https://gist.github.com/PlugFox/9849994d1f229967ef5dc408cb6b7647
*
* BytesBuilder | builder.add(chunk) | 7 us.
* AddAll | list.addAll(chunk) | 594 us.
* Spread | [...list, ...chunk] | 1016446 us.
* Concatenation | list + chunk | 1005022 us.
@inchoate
inchoate / readme.md
Last active April 24, 2024 09:37
Open clicked URLs into a particular Google Chrome profile

Problem

When I click on links from Slack or Outlook on MacOS they open in seemingly random browser windows/profiles. This is annoying.

Solution

Open links in a particular google chrome profile window. Be less annoyed.

  1. In Chrome, visit chrome://version and find the desired profile name. Mine was Default. Copy that profile's directory name, like Profile 2 or Default, not the profile's vanity name you see when you click on your profile icon in the browser.
  2. Install Finicky: brew install finicky. After install it should be running and you should see the icon in the upper toolbar.
  3. From the Finicky Toolbar Item, click > Config > Create New
  4. Edit the new file ~/.finicky and make it look something like this, filling in your profile name:
@prologic
prologic / weed.yml
Created May 25, 2021 03:07
SeaweedFS Docker Swarm Stack
---
version: "3.8"
services:
master:
image: chrislusf/seaweedfs:latest
command: master -mdir=/data
networks:
- weed
@steviee
steviee / pseudo.rake
Last active October 15, 2021 13:06
Pseudonomize user data in production DB (a copy, hopefully!)
# frozen_string_literal: true
require 'progress_bar'
require 'json'
require 'open-uri'
namespace :pseudo do
desc 'Pseudonymize user data'
task :perform => :environment do
count = User.count # get count of users currently in DB
bar = ProgressBar.new(count) # prepare some nice output
@arbakker
arbakker / README.md
Last active September 28, 2023 13:07
Manipulate GeoJSON/JSON with jq

Manipulate (Geo)JSON with jq

Remove attributes with jq from a GeoJSON file:

cat points.geojson | jq ".features[].properties |= del(.c) | .features[].properties |= del(.d)"

Add property with default value:

@NeatSnippets
NeatSnippets / home.dart
Created August 30, 2020 06:52
How to hide bottom navigation bar when scrolling in Flutter
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class Home extends StatefulWidget {
Home({Key key}) : super(key: key);
@override
_HomeState createState() => _HomeState();
}
@simolus3
simolus3 / cipher_db.dart
Last active January 15, 2021 09:08
Template to use moor_ffi with SQLCipher
import 'dart:async';
import 'dart:ffi';
import 'dart:io';
import 'dart:math';
import 'package:moor/backends.dart';
import 'package:moor/moor.dart';
import 'package:moor_ffi/moor_ffi.dart';
import 'package:moor_ffi/open_helper.dart';
@eingress
eingress / launch.json
Last active December 16, 2022 11:17
VSCode Flutter launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Android Phone",
"request": "launch",
"type": "dart",
"deviceId": "Device Name"
},
{
@felangel
felangel / main.dart
Created December 13, 2019 00:09
[flutter_bloc] Location Stream Example
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:bloc/bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:meta/meta.dart';
import 'package:geolocator/geolocator.dart';
void main() => runApp(MyApp());