Skip to content

Instantly share code, notes, and snippets.

@ackuser
ackuser / merge_vs_rebase_vs_squash.md
Created April 10, 2024 11:02 — forked from mitchellh/merge_vs_rebase_vs_squash.md
Merge vs. Rebase vs. Squash

I get asked pretty regularly what my opinion is on merge commits vs rebasing vs squashing. I've typed up this response so many times that I've decided to just put it in a gist so I can reference it whenever it comes up again.

I use merge, squash, rebase all situationally. I believe they all have their merits but their usage depends on the context. I think anyone who says any particular strategy is the right answer 100% of the time is wrong, but I think there is considerable acceptable leeway in when you use each. What follows is my personal and professional opinion:

@ackuser
ackuser / index.html
Created January 24, 2024 15:01 — forked from laurakelly/index.html
Connecting Two Points with a Line in D3.js
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="graph">
<h1>Connecting Two Points with a Line in D3.js</h1>
</div>
@ackuser
ackuser / mat-dynamic-table.component.ts
Created January 17, 2024 12:07 — forked from rakia/mat-dynamic-table.component.ts
Material Dynamic Table Angular component - typescript part
/**
* Table component that accepts column and row definitions in its content to be registered to the table.
*/
@Component({
selector: 'mat-dynamic-table',
templateUrl: './mat-dynamic-table.component.html',
styleUrls: ['./mat-dynamic-table.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class MatDynamicTableComponent<T> implements OnInit, OnChanges, AfterContentInit {
@ackuser
ackuser / README.md
Created December 7, 2023 12:00 — forked from tophtucker/README.md
d3 color-legend example

In response to a question on Twitter by @everybody_kurts:

“Hi @mbostock, I was looking at your stacked area chart at https://observablehq.com/@d3/stacked-area-chart. At the end of the file, you import swatches from "@d3/color-legend". I tried finding this on npmjs but to no avail. Is this exclusive to @observablehq only?”

This shows how to use the swatches function from the @d3/color-legend notebook in a plain HTML page. The example data for the swatches (the color scale and margin) is copied from the @d3/stacked-area-chart notebook.

@ackuser
ackuser / GeoJSON_TopoJSON.md
Created July 4, 2023 04:28 — forked from arthur-e/GeoJSON_TopoJSON.md
Installation and use of topojson and geojson command line interfaces for simplifying OGC geometries

Installation

# Requires Node.js and NPM
sudo npm install -g topojson

# Install the geojson-cli
sudo npm install -g geojson

Tasks

@ackuser
ackuser / .block
Created July 1, 2023 06:53 — forked from mbostock/.block
Merging States
license: gpl-3.0
@ackuser
ackuser / 00_README.md
Created June 20, 2023 06:58 — forked from LeZuse/00_README.md
Install node on Apple Silicon M1 both ARM and x86 (Rosetta)

Node.js on Apple Silicon

Node Version Manager (https://github.com/nvm-sh/nvm) works perfectly across native node installations as well as emulated Rosetta installations. The trick I am using here is to install one LTS version of node under Rosetta and another stable version as native binary.

TODO

  • find a way how to run the same node version on both platforms
@ackuser
ackuser / fix-dyld-missing-symbol-called-errors-on-m1-macs.md
Created May 12, 2023 07:19 — forked from adrienjoly/fix-dyld-missing-symbol-called-errors-on-m1-macs.md
Fix `dyld[]: missing symbol called` errors when running Node.js programs on M1 Macs

Problem

If you're getting this kind of error when running Node.js programs with binary dependencies that don't support M1 yet, e.g.:

$ yarn test
dyld[51175]: missing symbol called
dyld[51176]: missing symbol called
@ackuser
ackuser / paginated.interface.ts
Created May 3, 2023 09:22 — forked from tugascript/paginated.interface.ts
A Generic Paginated Type for GraphQL in NestJS code first approach
export interface IEdge<T> {
cursor: string;
node: T;
}
interface IPageInfo {
endCursor: string;
hasNextPage: boolean;
}
@ackuser
ackuser / security.conf
Created April 17, 2023 08:15 — forked from ambroisemaupate/security.conf
Nginx CSP example
# config to don't allow the browser to render the page inside an frame or iframe
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri
# https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
add_header X-Frame-Options SAMEORIGIN;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,
# to disable content-type sniffing on some browsers.
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers
# currently suppoorted in IE > 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx