Skip to content

Instantly share code, notes, and snippets.

@varemenos
varemenos / 1.README.md
Last active April 4, 2025 03:30
Git log in JSON format

Get Git log in JSON format

git log --pretty=format:'{%n  "commit": "%H",%n  "abbreviated_commit": "%h",%n  "tree": "%T",%n  "abbreviated_tree": "%t",%n  "parent": "%P",%n  "abbreviated_parent": "%p",%n  "refs": "%D",%n  "encoding": "%e",%n  "subject": "%s",%n  "sanitized_subject_line": "%f",%n  "body": "%b",%n  "commit_notes": "%N",%n  "verification_flag": "%G?",%n  "signer": "%GS",%n  "signer_key": "%GK",%n  "author": {%n    "name": "%aN",%n    "email": "%aE",%n    "date": "%aD"%n  },%n  "commiter": {%n    "name": "%cN",%n    "email": "%cE",%n    "date": "%cD"%n  }%n},'

The only information that aren't fetched are:

  • %B: raw body (unwrapped subject and body)
  • %GG: raw verification message from GPG for a signed commit
@mathiasbynens
mathiasbynens / web-platform-status-links.md
Last active February 8, 2025 12:35
Web platform status links
@yang-wei
yang-wei / destructuring.md
Last active December 2, 2024 06:40
Elm Destructuring (or Pattern Matching) cheatsheet

Should be work with 0.18

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !

Tuple

myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))
@bangonkali
bangonkali / symlink.sh
Created August 9, 2016 15:03
Creating a symlink for visual studio code on mac os x el capitan
@evancz
evancz / data-interchange.md
Last active December 31, 2024 01:04
Why do I have to write JSON decoders in Elm?

A vision for data interchange in Elm

How do you send information between clients and servers? What format should that information be in? What happens when the server changes the format, but the client has not been updated yet? What happens when the server changes the format, but the database cannot be updated?

These are difficult questions. It is not just about picking a format, but rather picking a format that can evolve as your application evolves.

Literature Review

By now there are many approaches to communicating between client and server. These approaches tend to be known within specific companies and language communities, but the techniques do not cross borders. I will outline JSON, ProtoBuf, and GraphQL here so we can learn from them all.

@bgourlie
bgourlie / mortality.md
Last active December 2, 2017 21:54
Interpreting DUSCMPUB-formatted mortality data

Interpreting mortality data in DUSCMPUB format

This gist explains how to interpret the DUSCMPUB-formatted mortality data found [here][1] in conjunction with the [reference PDF][2].

The [reference PDF][2] uses 3 components to describe the type of data, its location within the row, and its size:

  • data item: A specific datapoint, for example, a value representing the highest completed level of education.
  • tape location: The column within the line where a data item is located. Each character in a line represents a column, with each line having 472 columns.
  • size: The number of columns used to represent a particular data item.
@jan-warchol
jan-warchol / sync-history.sh
Last active January 3, 2025 14:37
Synchronize history across bash sessions
# Synchronize history between bash sessions
#
# Make history from other terminals available to the current one. However,
# don't mix all histories together - make sure that *all* commands from the
# current session are on top of its history, so that pressing up arrow will
# give you most recent command from this session, not from any session.
#
# Since history is saved on each prompt, this additionally protects it from
# terminal crashes.
@JoelQ
JoelQ / elm-types-glossary.md
Last active March 30, 2025 21:26
Elm Type Glossary

Elm Types Glossary

There's a lot of type terminology and jargon going around when discussing types in Elm. This glossary attempts to list some of the most common type terms along with synonyms, terms from other language communities, examples, and links to more detailed articles on each topic.

@fvclaus
fvclaus / README.md
Last active January 8, 2024 16:16
Run vscode tasks with nvm

Nvm does not work in vscode tasks, because tasks are run without a shell. .bashrc is not loaded and the nvm command is unknown.

My solution uses a wrapper script around /bin/bash that reads in the correct node version from .npmrc in the project folder.

#!/bin/bash

set -e

if [[ "$2" == nvm* ]]; then

export NODE_VERSION=v$(cat .nvmrc)

@LewisGaul
LewisGaul / zig-blog-posts.md
Last active February 26, 2025 03:07
Collection of blog posts about the Zig programming language