# gist

Published articles for gist.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Do you really need tsvector column?

DevFeed: [Do you really need tsvector column?](<https://devfeed.tech/articles/do-you-really-need-tsvector-column-33668.md>)

Original publisher: [Read original article](<https://www.depesz.com/2025/11/03/do-you-really-need-tsvector-column/>)

Author: depesz

Published: 2025-11-03T12:34:33Z

Content type: article

Language: en

Sources: [select \* from depesz;](<https://devfeed.tech/sources/select-from-depesz.md>)

Topics: [data](<https://devfeed.tech/topics/data.md>), [Query (disambiguation)](<https://devfeed.tech/topics/query.md>), [Algorithm](<https://devfeed.tech/topics/algorithm.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [benchmark](<https://devfeed.tech/tags/benchmark.md>), [comparison](<https://devfeed.tech/tags/comparison.md>), [data](<https://devfeed.tech/tags/data.md>), [function](<https://devfeed.tech/tags/function.md>), [gin](<https://devfeed.tech/tags/gin.md>), [gist](<https://devfeed.tech/tags/gist.md>), [index](<https://devfeed.tech/tags/index.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [query](<https://devfeed.tech/tags/query.md>), [tsearch](<https://devfeed.tech/tags/tsearch.md>), [tsvector](<https://devfeed.tech/tags/tsvector.md>), [uncategorized](<https://devfeed.tech/tags/uncategorized.md>)

### AI overview

This article tests whether a materialized tsvector column is necessary for full-text search. Using a large Wikipedia-derived dataset, it compares a tsvector column with an expression-based function index and reports that the tested query took about 4.5 minutes with the materialized column versus almost an hour with the function-based index.

### Source excerpt

When using tsearch one usually, often, creates a tsvector column to put data in, and then create index on it. But, do you really need the index? I wrote once already that you don't have to, but then a person talked with me on IRC, and pointed this section of docs: One advantage of the ... Continue reading "Do you really need tsvector column?"

## Using GitHub Gists and Markdown to Share Text Documents

DevFeed: [Using GitHub Gists and Markdown to Share Text Documents](<https://devfeed.tech/articles/welcome-to-gist-github-com-username-28172.md>)

Original publisher: [Read original article](<http://fuzzyblog.io/blog/git/2020/01/17/welcome-to-gist-github-com-username.html>)

Author: Fuzzygroup

Published: 2020-01-17T00:00:00Z

Content type: tutorial

Language: en

Sources: [Scott Johnson](<https://devfeed.tech/sources/scott-johnson.md>)

Topics: [GitHub](<https://devfeed.tech/topics/github.md>), [Markdown](<https://devfeed.tech/topics/markdown.md>)

Tags: [gist](<https://devfeed.tech/tags/gist.md>), [git](<https://devfeed.tech/tags/git.md>), [github](<https://devfeed.tech/tags/github.md>), [internet](<https://devfeed.tech/tags/internet.md>), [markdown](<https://devfeed.tech/tags/markdown.md>)

### AI overview

A tutorial explains how to use GitHub Gists as a lightweight way to share text documents for review. It describes creating a gist, using a Markdown filename such as timeline.md, and choosing a public or secret gist.

### Source excerpt

I'd love to tell you that I figured this one out on my own but I didn't - my friend Nick Janetakis taught me this trick. Here's the problem statement: When you have a text document that you want someone to review, how do you put that document onto the Internet? One obvious answer is Google Docs. Another is some kind of shared file tool like Dropbox. But these tools are heavy. The idea of a heavy tool is a developer thing and it means that the tool does so much more than you need to solve the problem that using it feels awkward. So let's restate the problem: When you have a text document that you want someone to review, what's a lightweight tool that you can use to put that document on the Internet? When you start to work with people online, they often show you some cool tool that you never knew existed. And this is just that type of thing. Nick showed me: https://gist.github.com/ If you goto https://gist.github.com/ when you are logged into Github then you get a place where you can create a gist. The idea of a gist is that it is a snippet of text that you share online. Now this was originally written for Programmer Foo to share a code routine with Programmer Bar who, in turn, might them change it and share with Programmer Baz. Now you might be thinking that how does a web based code sharing tool make it possible for you to share a document ? The answer is simple: markdown. Markdown is an Internet standard for online writing which uses simple ASCII encoding to generate html. For example a single # character means "Make a Heading of Level 1", two ## characters means "Make a heading of Level 2". Here is a Markdown Cheatsheet. What you can do to share a document is this: Create a github account if you don't have one and login. Go to gist.github.com and click the + sign in the black header. This creates a new gist which gives you a web form where you can enter it. Enter a filename like timeline.md (the .md extension is for markdown). The filename extension tells Github h

## Custom Jekyll pagination

DevFeed: [Custom Jekyll pagination](<https://devfeed.tech/articles/custom-jekyll-pagination-37260.md>)

Original publisher: [Read original article](<https://muffinman.io/blog/custom-jekyll-pagination/>)

Author: Stanko

Published: 2016-02-22T00:00:00Z

Content type: tutorial

Language: en

Sources: [Stanko Tadić](<https://devfeed.tech/sources/stanko-tadic.md>)

Topics: [Jekyll](<https://devfeed.tech/topics/jekyll.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [custom](<https://devfeed.tech/tags/custom.md>), [gist](<https://devfeed.tech/tags/gist.md>), [jekyll](<https://devfeed.tech/tags/jekyll.md>), [pagination](<https://devfeed.tech/tags/pagination.md>)

### AI overview

This tutorial describes customizing Jekyll pagination to show at least five page links with the current page centered, plus first and last page links on larger screens while retaining Newer and Older links. It points readers to the implementation code and a screenshot.

### Source excerpt

Please note that I'm not using Jekyll anymore, so this post might be outdated. Jekyll comes with simple pagination which has only Newer and Older links. I wanted a little bit more, now pagination shows at least five pages, with current in the middle. On the larger screens there are also first and last page links. Newer and Older links are, of course, still there. Check the gist with the code. You can see it at the bottom of this website, or just check the screenshot below:

## Preview Arbitrary HTML

DevFeed: [Preview Arbitrary HTML](<https://devfeed.tech/articles/preview-arbitrary-html-31914.md>)

Original publisher: [Read original article](<http://blog.jayfields.com/2015/01/preview-arbitrary-html.html>)

Author: Jay (noreply@blogger.com)

Published: 2015-01-08T15:23:00Z

Content type: tutorial

Language: en

Sources: [Jay Fields](<https://devfeed.tech/sources/jay-fields.md>)

Topics: [HTML](<https://devfeed.tech/topics/html.md>), [gist](<https://devfeed.tech/topics/gist.md>), [GitHub](<https://devfeed.tech/topics/github.md>), [Markdown](<https://devfeed.tech/topics/markdown.md>)

Tags: [gist](<https://devfeed.tech/tags/gist.md>), [github](<https://devfeed.tech/tags/github.md>), [html](<https://devfeed.tech/tags/html.md>), [markdown](<https://devfeed.tech/tags/markdown.md>)

### AI overview

A short tutorial explains how to preview arbitrary HTML by changing a GitHub Gist file extension to .md. GitHub renders Markdown Gists with inline HTML, making this useful for sharing short-lived rendered HTML.

### Source excerpt

I'm a big fan of https://gist.github.com/ for sharing code. It's fantastic for quickly putting something online to talk over with someone else. I've often found myself wishing for something that allowed me to share rendered HTML in the same way. For example, a gist of the HTML for this blog entry can be seen here: https://gist.github.com/jaycfields/82e2cc0a588bd83a91f4. If I want someone to give me feedback on the rendered output, that gist isn't very helpful. It turns out, it's really easy to see that HTML rendered: switch the file extension to md. Here's the same gist with a md extension: https://gist.github.com/jaycfields/e383b12b6ff9bd49c40a This all works due to the way Github renders markdown gists, and markdown supporting inline HTML. I wouldn't use this trick to create any data you'd like to have online in the long term, but it's great for sharing short lived HTML. © Jay Fields - www.jayfields.com

## Top Github Languages of 2014 (So far)

DevFeed: [Top Github Languages of 2014 (So far)](<https://devfeed.tech/articles/top-github-languages-of-2014-so-far-32166.md>)

Original publisher: [Read original article](<https://adambard.com/blog/top-github-languages-2014/>)

Published: 2014-08-01T00:00:00Z

Content type: article

Language: en

Sources: [Adam Bard](<https://devfeed.tech/sources/adam-bard.md>)

Topics: [GitHub](<https://devfeed.tech/topics/github.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [BigQuery](<https://devfeed.tech/topics/bigquery.md>), [Python](<https://devfeed.tech/topics/python.md>), [gist](<https://devfeed.tech/topics/gist.md>)

Tags: [bigquery](<https://devfeed.tech/tags/bigquery.md>), [gist](<https://devfeed.tech/tags/gist.md>), [github](<https://devfeed.tech/tags/github.md>), [programming](<https://devfeed.tech/tags/programming.md>), [programming-languages](<https://devfeed.tech/tags/programming-languages.md>), [python](<https://devfeed.tech/tags/python.md>)

### AI overview

An analysis of GitHub Archive data from the first half of 2014 compares programming-language repository counts with equivalent periods in 2013 and 2012. The author cautions that GitHub's language-detection heuristics may substantially skew the results.

### Source excerpt

It's that time of year again! Today, we'll look at just over a half-year's worth of Github data to draw unsubstantiated conclusions about the relative popularity of programming languages. Ok let's go!

## Presentation slides and writer's block

DevFeed: [Presentation slides and writer's block](<https://devfeed.tech/articles/presentation-slides-and-writer-s-block-35544.md>)

Original publisher: [Read original article](<https://meowni.ca/posts/slides-writers-block/>)

Author: Monica Dinculescu

Published: 2014-04-09T00:00:00Z

Content type: article

Language: en

Sources: [Monica Dinculescu](<https://devfeed.tech/sources/monica-dinculescu.md>)

Topics: [Template](<https://devfeed.tech/topics/template.md>), [Markdown](<https://devfeed.tech/topics/markdown.md>), [gist](<https://devfeed.tech/topics/gist.md>), [C](<https://devfeed.tech/topics/c.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Java](<https://devfeed.tech/topics/java.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [gist](<https://devfeed.tech/tags/gist.md>), [java](<https://devfeed.tech/tags/java.md>), [markdown](<https://devfeed.tech/tags/markdown.md>), [presentation](<https://devfeed.tech/tags/presentation.md>), [template](<https://devfeed.tech/tags/template.md>)

### AI overview

The author describes a workflow for overcoming writer's block when creating presentation slides: outline the talk, let the outline develop, use a simple presentation template focused on content, and rehearse with presenter's notes.

### Source excerpt

I am the poster child for writer's block. I can't write the #ifdef header guard correctly for a brand new C++ class, I don't remember the order of the public static void main args incantation in Java, and for the life of me, I can't start working on an empty presentation. Not even if you promise me pizza. (Please promise me pizza though.) Start with an outline There's already an amazing speaking.io post about writing outlines which you should read. The tl;dr is that you start with the top-level things that you want to talk about (feel free to s/2Pac/Biggie/g in that example if a) you have good taste or b) you're from the East Coast because c) yolo), and then slowly, but with gumption, start developing dem ideas. I personally take that post literally and write my outline as a markdown gist. The top-level ideas are ## headers, the supporting points are sub-bullets, and there's a lot of "???. Profit!" and notes to future-Monica, because present-Monica is usually a jerk. Time to procrastinate This is great! You have an outline! You deserve a break. No, really; take a break. I let this baby stew for a couple of days, so that it gets nice and tender. Nobody likes an undercooked outline. It's also not a terrible idea at this point to ask some of your friends to read your outline and tell you if this would be a talk they wouldn't hate listening to. Time for Skeletor™ Once you think you've procrastinated enough and it's time to actually work on your presentation, you'll be tempted to start thinking about slide design, typefaces, and the kind of cat gifs you'll include for bonus points. Don't. I mean, definitely include cat gifs, but that time isn't now. I'm pretty sure "being OCD about typography" is correlated with "being really good at writer's block", so I can promise that you'll waste many evenings choosing drop shadows before you realize how screwed you are for content. I've sorted this out by having a really basic presentation template, affectionately named Skeletor, t

## Tooling for Simple but Informative Emails

DevFeed: [Tooling for Simple but Informative Emails](<https://devfeed.tech/articles/tooling-for-simple-but-informative-emails-41153.md>)

Original publisher: [Read original article](<https://www.craigkerstiens.com/2013/10/13/Tooling-for-Simple-but-Informative-Emails/>)

Author: Map

Published: 2013-10-13T20:55:56Z

Content type: tutorial

Language: en

Sources: [Craig Kerstiens](<https://devfeed.tech/sources/craig-kerstiens.md>)

Topics: [Tooling](<https://devfeed.tech/topics/tooling.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [CSV](<https://devfeed.tech/topics/csv.md>), [email](<https://devfeed.tech/topics/email.md>), [Script](<https://devfeed.tech/topics/script.md>)

Tags: [csv](<https://devfeed.tech/tags/csv.md>), [email](<https://devfeed.tech/tags/email.md>), [gist](<https://devfeed.tech/tags/gist.md>), [github](<https://devfeed.tech/tags/github.md>), [hacks](<https://devfeed.tech/tags/hacks.md>), [password](<https://devfeed.tech/tags/password.md>), [script](<https://devfeed.tech/tags/script.md>), [sql](<https://devfeed.tech/tags/sql.md>), [tips](<https://devfeed.tech/tags/tips.md>), [tooling](<https://devfeed.tech/tags/tooling.md>)

### AI overview

A practical tutorial on sending concise, informative user emails with a simple script, using SQL to prepare recipient data and CSV to provide input.

### Source excerpt

Emails are one of my favorite methods of communicating with users. Its works as a quick test for product validation. It works well at one->some->many-> all. Its still highly effective even as much noise as we receive in our inboxes. Over the years I've tried a lot of email tools from custom built solutions, to newer entrants that help around drip actions (intercom.io and customer.io), to more "enterprise" tools such as Marketo. While I have varying opinions on all of those, I still find myself coming back to a simple one off script setup to deliver clear concise emails. Getting the Data The first step of any email is deciding what you want to do, but hopefully you know that already. The part that is usually a bit more effort is actually getting the list to send it to and formatting it appropriately. I usually opt for SQL. While the specifics of the query of course always vary it common follows a general structure: WITH initial_data AS ( SELECT email, app_name, information_about_app FROM users, apps WHERE users.id = apps.user_id AND some_filter_to_limit_data ), candidates_for_email AS ... --- likely to have additional CTEs --- Finally I build up the list SELECT email, array_to_string(array_agg(data_for_email), ' ') --- an important note is to add a newline or not here depending on how you wish to format it FROM candidates_for_email GROUP BY email; The query structure you'll want is first column email, second column whatever data you want to include in your email. From here I usually create a dataclip of it. This makes it easy to allow my data to change over time. If I'm testing an email for data over the last 7 days I just come back in 7 days and I have new data. It also lets me easily share and iterate on the data. The nice part is there's an easy way to click a button and get the data as a CSV which is what you want for sending. Once you download the CSV you'll want to remove the header line as its not needed for the script. Sending the Mail To actually send the em

## Gist: My New Devbook

DevFeed: [Gist: My New Devbook](<https://devfeed.tech/articles/gist-my-new-devbook-21178.md>)

Original publisher: [Read original article](<https://juri.dev/blog/2012/12/gist-my-new-devbook/>)

Published: 2012-12-17T00:00:00Z

Content type: article

Language: en

Sources: [Juri Strumpflohner](<https://devfeed.tech/sources/juri-strumpflohner.md>)

Topics: [Development](<https://devfeed.tech/topics/development.md>), [Code](<https://devfeed.tech/topics/code.md>), [Java](<https://devfeed.tech/topics/java.md>), [Swing](<https://devfeed.tech/topics/swing.md>), [Software](<https://devfeed.tech/topics/software.md>), [web applications](<https://devfeed.tech/topics/web-applications.md>), [Google](<https://devfeed.tech/topics/google.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [development](<https://devfeed.tech/tags/development.md>), [eclipse](<https://devfeed.tech/tags/eclipse.md>), [gist](<https://devfeed.tech/tags/gist.md>), [google](<https://devfeed.tech/tags/google.md>), [java](<https://devfeed.tech/tags/java.md>), [knowledge-base](<https://devfeed.tech/tags/knowledge-base.md>), [web-applications](<https://devfeed.tech/tags/web-applications.md>)

### AI overview

The article recounts the evolution of Devbook, a personal knowledge base for software development and code snippets. It began as a Java Swing desktop client backed by Microsoft Access, was experimentally ported to Eclipse RCP, and later became a GWT web application hosted on Google App Engine. The project ultimately remained mainly experimental.

### Source excerpt

Lorem ipsum dolor sit amet

## Arrays in Postgres

DevFeed: [Arrays in Postgres](<https://devfeed.tech/articles/arrays-in-postgres-41117.md>)

Original publisher: [Read original article](<https://www.craigkerstiens.com/2012/08/20/Arrays-in-Postgres/>)

Author: Map

Published: 2012-08-20T20:55:56Z

Content type: tutorial

Language: en

Sources: [Craig Kerstiens](<https://devfeed.tech/sources/craig-kerstiens.md>)

Topics: [data](<https://devfeed.tech/topics/data.md>), [Data structures](<https://devfeed.tech/topics/data-structures.md>), [App](<https://devfeed.tech/topics/app.md>)

Tags: [application](<https://devfeed.tech/tags/application.md>), [arrays](<https://devfeed.tech/tags/arrays.md>), [development](<https://devfeed.tech/tags/development.md>), [gin](<https://devfeed.tech/tags/gin.md>), [gist](<https://devfeed.tech/tags/gist.md>), [indexes](<https://devfeed.tech/tags/indexes.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [query](<https://devfeed.tech/tags/query.md>)

### AI overview

This tutorial explains how PostgreSQL arrays can store multiple values in a single column or row. It discusses modeling data with arrays, gives purchase and tagging examples, and notes that GIN and GiST indexes can support searches for array contents.

### Source excerpt

Postgres out of the box has an abundance of datatypes, from standard numeric datatypes to geometric or even network datatypes. With extensions you can get even more out of it as earlier discussed with hStore. Though with all of the datatypes its easy to miss out on some of them that are there, in fact one of my favorites is often missed entirely. The Array datatype lets you do just as you'd expect, store an array inside Postgres. With this you can often get some of the functionality you'd want in a single table when you might traditionally have expanded to multiple tables. The broader question may be why you'd actually want to use an array. One good reason may be if you're an application developer its how you think of your data, so why not model it the same way. As you'll see below it can be easier than joining and aggregating across a set of rows. Also depending on your case you performance could be improved, though mileage may vary here as it does depend on the data you're storing. First a bit of a hacky example... Lets say you have a basic website that sells stuff, and instead of having a purchase ID and a total you want to include the quantity, id, and price of each item in a single row. With a bit of a messy foreign key (using a decimal) you could store all of this within a single row: CREATE TABLE purchases ( id integer NOT NULL, user_id integer, items decimal(10,2) [100][1], occurred_at timestamp ); With this table I could have an array that holds multiple records of: The item purchased The quantity The price An insert to this table would look something like: INSERT INTO purchases VALUES (1, 37, '\{\{15.0, 1.0, 25.0\}, \{15.0, 1.0, 25.0\}\}', now()); INSERT INTO purchases VALUES (2, 2, '{{11.0, 1.0, 4.99}}', now()); You can see a full example with UDF's to compute total here A more practical example may actually be using an array for tags. If you were to tag your purchases: CREATE TABLE products ( id integer NOT NULL, title character varying(255), description t

## How to generate error log from nested exceptions.

DevFeed: [How to generate error log from nested exceptions.](<https://devfeed.tech/articles/how-to-generate-error-log-from-nested-exceptions-38414.md>)

Original publisher: [Read original article](<https://khmylov.com/2012/04/how-to-generate-error-log-from-nested-exceptions/>)

Author: Andrew Khmylov

Published: 2012-04-24T00:00:00Z

Content type: tutorial

Language: en

Sources: [Despite the odds](<https://devfeed.tech/sources/despite-the-odds.md>)

Topics: [Exception](<https://devfeed.tech/topics/exception.md>), [exceptions](<https://devfeed.tech/topics/exceptions.md>), [Code](<https://devfeed.tech/topics/code.md>), [Logging](<https://devfeed.tech/topics/logging.md>), [console](<https://devfeed.tech/topics/console.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [error](<https://devfeed.tech/tags/error.md>), [exceptions](<https://devfeed.tech/tags/exceptions.md>), [gist](<https://devfeed.tech/tags/gist.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [logging](<https://devfeed.tech/tags/logging.md>), [simple](<https://devfeed.tech/tags/simple.md>)

### AI overview

This code-focused tutorial demonstrates how to generate readable error logs from nested exceptions in C#. It recursively traverses inner exceptions and handles AggregateException by flattening its InnerExceptions collection.

### Source excerpt

Working on error logging for my new application I've realized that I always use the same pattern when it comes to converting actual exceptions into a text form. And since I started posting rare code snippets that I write down all the time on Gist recently, there will be a number of 'sharing code' blog posts in the foreseeable future. The code is rather simple, it traverses down the entire nested exception hierarchy and populates StringBuilder with the appropriate error information. There is a slightly different workflow for AggregateException - we want to flatten its InnerExceptions collection. public string GetExceptionLog(Exception exception) { return UnwrapExceptionTextLoop(new StringBuilder(), 0, exception); } private string UnwrapExceptionTextLoop(StringBuilder sb, int level, Exception e) { if (e == null) { return sb.ToString(); } for (int i = 0; i < level; i++) { sb.Append(">>"); } var aggregate = e as AggregateException; sb.AppendFormat("{0} - {1} [{2}] {3}", e.GetType(), aggregate == null ? e.Message : String.Empty, e.StackTrace, Environment.NewLine); if (aggregate != null) { return String.Join(Environment.NewLine, aggregate.InnerExceptions.Select(inner => UnwrapExceptionTextLoop(sb, level + 1, inner))); } return UnwrapExceptionTextLoop(sb, level + 1, e.InnerException); } Let's put on a simple method that throws several exceptions: public void TestMethod() { try { try { throw new Exception("Inner exception"); } catch (Exception ex) { throw new Exception("Outer exception"); } } catch (Exception ex) { Console.WriteLine(ErrorHelper.GetExceptionLog(ex)); } } And here is the result (I've omitted the large stack trace information): System.Exception - Outer exception [ at Client.App.TestMethod()..] >>System.Exception - Inner exception [ at Client.App.TestMethod()..]