Skip to content

Instantly share code, notes, and snippets.

View 92Sam's full-sized avatar

Sam 92Sam

  • Portugal
View GitHub Profile
@popravich
popravich / PostgreSQL_index_naming.rst
Last active March 25, 2024 12:42
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;
@chrisma
chrisma / named_colors.json
Created December 1, 2014 22:35
Named color JSON data, extracted from Wikipedia's "List of colors", accessed 01-12-2014.
[
{"name":"Acid green","hex":"#B0BF1A","rgb":[176,191,26],"hsl":[65,76,43],"hsv":[65,86,75]},
{"name":"Aero","hex":"#7CB9E8","rgb":[124,185,232],"hsl":[206,70,70],"hsv":[206,47,91]},
{"name":"Aero blue","hex":"#C9FFE5","rgb":[201,255,229],"hsl":[151,100,89],"hsv":[151,21,100]},
{"name":"African violet","hex":"#B284BE","rgb":[178,132,190],"hsl":[288,31,63],"hsv":[288,31,75]},
{"name":"Air Force blue (RAF)","hex":"#5D8AA8","rgb":[93,138,168],"hsl":[204,30,51],"hsv":[204,45,66]},
{"name":"Air Force blue (USAF)","hex":"#00308F","rgb":[0,48,143],"hsl":[220,100,28],"hsv":[220,100,56]},
{"name":"Air superiority blue","hex":"#72A0C1","rgb":[114,160,193],"hsl":[205,39,60],"hsv":[205,41,76]},
{"name":"Alabama crimson","hex":"#AF002A","rgb":[175,0,42],"hsl":[346,100,34],"hsv":[346,100,69]},
{"name":"Alice blue","hex":"#F0F8FF","rgb":[240,248,255],"hsl":[208,100,97],"hsv":[208,6,100]},
@robschmuecker
robschmuecker / README.md
Last active April 24, 2024 14:12
D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing.

This example pulls together various examples of work with trees in D3.js.

The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.

One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.

Dragging can be performed on any node other than root (flare). Dropping can be done on any node.

Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.