Skip to content

Instantly share code, notes, and snippets.

View tmcw's full-sized avatar
💭
merging your prs

Tom MacWright tmcw

💭
merging your prs
View GitHub Profile
@popravich
popravich / PostgreSQL_index_naming.rst
Last active May 30, 2024 06:39
PostgreSQL index naming convention to remember

The standard names for indexes in PostgreSQL are:

{tablename}_{columnname(s)}_{suffix}

where the suffix is one of the following:

  • pkey for a Primary Key constraint;
  • key for a Unique constraint;
  • excl for an Exclusion constraint;
  • idx for any other kind of index;
@LingDong-
LingDong- / encode_anim_gif.js
Created September 15, 2023 00:27
minimal animated GIF encoder in 50 lines
// encode_anim_gif.js
// minimal code to make animated GIFs from arrays of pixels
// - no compression
// - supports 127 colors (127 shades of gray by default)
function encode_anim_gif(frames,w,h,delay=5){
let bytes = [];
bytes.push(0x47,0x49,0x46,0x38,0x39,0x61);
bytes.push(w&0xff);
bytes.push((w>>8)&0xff);