Skip to content

Instantly share code, notes, and snippets.

View jchv's full-sized avatar

jchv

  • United States
View GitHub Profile
@adtac
adtac / Dockerfile
Last active August 25, 2024 05:52
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@sheniff
sheniff / emojis
Last active September 11, 2015 19:23
Emojis!
ʘ‿ʘ
Innocent face
ಠ_ಠ
Reddit disapproval face
(╯°□°)╯︵ ┻━┻
Table Flip / Flipping Table
┬─┬ ノ( ゜-゜ノ)
@kimushu
kimushu / memchr.js
Last active June 13, 2018 14:22
Binary data operations by JavaScript TypedArray
/**
* Find a character from memory block
* @param {Uint8Array} s Array to find
* @param {Number} c Character to find
* @param {Number} n Length of array in bytes
* @return Zero-based index (if not found, returns -1)
*/
function memchr(s, c, n) {
return s.indexOf(c);
}
@matthewmccullough
matthewmccullough / git-compressing-and-deltas.md
Created May 14, 2012 19:05
Git, Compression, and Deltas - An explanation

Git Compression of Blobs and Packfiles.

Many users of Git are curious about the lack of delta compression at the object (blob) level when commits are first written. This efficiency is saved until the pack file is written. Loose objects are written in compressed, but non-delta format at the time of each commit.

A simple run though of a commit sequence with only the smallest change to the image (in uncompressed TIFF format to amplify the observable behavior) aids the understanding of this deferred and different approach efficiency.

The command sequence:

Create the repo: