Skip to content

Instantly share code, notes, and snippets.

@rabet
rabet / main.go
Last active January 26, 2024 08:49
Write text into image with Go (with font.Drawer)
// Copyright 2015 The Freetype-Go Authors. All rights reserved.
// Use of this source code is governed by your choice of either the
// FreeType License or the GNU General Public License version 2 (or
// any later version), both of which can be found in the LICENSE file.
// +build example
//
// This build tag means that "go install github.com/golang/freetype/..."
// doesn't install this example program. Use "go run main.go" to run it or "go
// install -tags=example" to install it.
@uobikiemukot
uobikiemukot / emoji.go
Created December 11, 2018 07:58
emoji and text renderer
package main
import (
"bufio"
"bytes"
"fmt"
"image"
"image/jpeg"
_ "image/png"
"io"
@cdmckay
cdmckay / uuid_to_bytea.sql
Last active December 23, 2022 02:13
How to convert a PostgreSQL UUID to bytea
select decode(replace('45774962-e6f7-41f6-b940-72ef63fa1943'::text, '-', ''), 'hex');
-- And here's how to convert it to the ShortUUID format used in Process Street
select replace(encode(substring(decode(replace('45774962-e6f7-41f6-b940-72ef63fa1943'::text, '-', ''), 'hex') from 9 for 8) ||
substring(decode(replace('45774962-e6f7-41f6-b940-72ef63fa1943'::text, '-', ''), 'hex') from 1 for 8), 'base64'), '=', '');
<?php
namespace jkuchar\Doctrine\DBAL\Driver\PDOPgSql;
use Doctrine\DBAL\Driver\PDOPgSql\Driver as DoctrineOriginalDriver;
/**
* Adds ability to set search path to PostgreSQL driver
* @package App\Doctrine