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
@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);
@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;
@tkafka
tkafka / LICENSE.txt
Last active September 5, 2019 13:38
Drop-in replacement for ReactCSSTransitionGroup that uses velocity.js instead of CSS transforms. Add your own transitions to `transitions` hash.
The MIT License (MIT)
Copyright (c) 2014 Tomas Kafka
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@avibryant
avibryant / gist:11376572
Last active March 13, 2016 01:51
Google <=> Open Source Rosetta Stone
GFS = HDFS
MapReduce = Hadoop
BigTable = HBase
Protocol Buffers = Thrift or Avro (serialization)
Stubby = Thrift or Avro (RPC)
ColumnIO = Parquet
Dremel = Impala
Chubby = Zookeeper
Omega = Mesos
Borg = Aurora
@XVilka
XVilka / TrueColour.md
Last active April 8, 2024 14:02
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@mbostock
mbostock / .block
Last active December 17, 2023 21:17
Save SVG as PNG
license: gpl-3.0
@konklone
konklone / dc-title-17.md
Last active December 15, 2015 21:38
DC Title 17 in Markdown, crazy alpha pass

TITLE 17: REVIEW (Chapter 1 and Chapter 3)

Section 17-101: Appeal from District of Columbia Court of Appeals; filing, form and contents of petition; procedure, generally, on appeal from District of Columbia Court of Appeals; record; rules of court; time for petitioning for allowance of appeal from District of Columbia Court of Appeals; determination of appeal from District of Columbia Court of Appeals. [Repealed]

CREDIT(S)

(July 29, 1970, 84 Stat. 565, Pub. L. 91-358, title I, § 146a1.)

Section 17-104: Appeal from District of Columbia Court of Appeals; filing, form and contents of petition; procedure, generally, on appeal from District of Columbia Court of Appeals; record; rules of court; time for petitioning for allowance of appeal from District of Columbia Court of Appeals; determination of appeal from District of Columbia Court of Appeals. [Repealed]
@sgillies
sgillies / geojson-is-spectacularly-wrong.rst
Last active December 12, 2015 08:39
Candidate talks for http://foss4g-na.org/call-for-presentations/. Comments and forks welcome. I'm also open to co-presenting.

GeoJSON is Spectacularly Wrong

Sean Gillies http://sgillies.net

This work is licensed under the Creative Commons Attribution 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

@tmcw
tmcw / ajax_for_cats.md
Last active April 19, 2021 21:08
AJAX for Cats

AJAX For Cats

I will assume that you are familiar with Javascript and HTML - read up on jsforcats.com if you need Javascript chops, and Learn HTML for HTML.

AJAX is a feature of Javascript and your browser that downloads new data after you initially request a page: so you live-update content and pull in new bits of content a user requests. AJAX is how the Pinterest home page keeps loading content when you scroll, and it's how Gmail can ring in new emails without requiring you to click 'refresh' all the time.

Let's clear things up. Like Javascript for Cats, it's best to use Google Chrome for this, and to use your web developer extensions.

Requests

@mbostock
mbostock / README.md
Last active June 7, 2023 18:33
Underscore’s Equivalents in D3

Collections

each(array)

Underscore example:

_.each([1, 2, 3], function(num) { alert(num); });