Skip to content

Instantly share code, notes, and snippets.

@kit-g
kit-g / interview.py
Last active March 7, 2025 19:04
Temporary git for an interview
import datetime
from dataclasses import dataclass
from typing import Optional, TypedDict, Union
from utils.cast import safe_int
from utils.convert import from_json, to_json
from utils.db import get
import models.queries
from language.feeds import repliers_badge
@kit-g
kit-g / message_bubble.dart
Created January 22, 2025 19:32
Simplified variant of the [Text] widget which accepts both a primary string for the raw text body, and a secondary `sentAt` string which annotates the former with a timestamp, similar to how popular chat apps like WhatsApp render individual messages.
import 'dart:math';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:linkify/linkify.dart';
/// Simplified variant of the [Text] widget which accepts both a primary string
/// for the raw text body, and a secondary `sentAt` string which annotates the
/// former with a timestamp, similar to how popular chat apps like WhatsApp
@kit-g
kit-g / gist:5d9115342a89b20517f25f0dc0c3873a
Created November 12, 2021 19:49 — forked from sgmccli/gist:33c9e513985e5f0042eed0d35ae76589
pgtap-0.97.0.sql compiled on Mac OSX
-- This file defines pgTAP, a collection of functions for TAP-based unit
-- testing. It is distributed under the revised FreeBSD license.
--
-- The home page for the pgTAP project is:
--
-- http://pgtap.org/
CREATE OR REPLACE FUNCTION pg_version()
RETURNS text AS 'SELECT current_setting(''server_version'')'
LANGUAGE SQL IMMUTABLE;