Skip to content

Instantly share code, notes, and snippets.

@hyperupcall
hyperupcall / settings.jsonc
Last active May 13, 2024 22:21
VSCode config to disable popular extensions' annoyances (telemetry, notifications, welcome pages, etc.)
// I'm tired of extensions that automatically:
// - show welcome pages / walkthroughs
// - show release notes
// - send telemetry
// - recommend things
//
// This disables all of that stuff.
// If you have more config, leave a comment so I can add it!!
{
@kconner
kconner / macOS Internals.md
Last active May 22, 2024 15:55
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@murtaza-u
murtaza-u / pre-commit
Last active December 18, 2023 06:27
Pre-commit Git hook to prevent accidentally committing `go.mod` with replace directive in it.
#!/bin/bash
root="$(git rev-parse --show-toplevel)"
cd "$root" || exit 1
if [[ ! -r go.mod ]]; then
exit 0
fi
mod="$(grep -E "^replace\s+.+\s{1}=>\s{1}.+$" go.mod 2>/dev/null)"
@sindresorhus
sindresorhus / esm-package.md
Last active May 23, 2024 17:50
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@a1ip
a1ip / hostname.md
Last active March 18, 2024 00:01
How to set the Mac hostname or computer name from the terminal

How to set the Mac hostname or computer name from the terminal

  1. Open a terminal.
  2. Type the following command to change the primary hostname of your Mac: This is your fully qualified hostname, for example myMac.domain.com
sudo scutil --set HostName <new host name>
  1. Type the following command to change the Bonjour hostname of your Mac: This is the name usable on the local network, for example myMac.local.
import { GraphQLRequestContext } from 'apollo-server-core/dist/requestPipelineAPI';
import { Request } from 'apollo-server-env';
import beeline from 'honeycomb-beeline';
import {
DocumentNode,
GraphQLResolveInfo,
ResponsePath,
ExecutionArgs,
GraphQLOutputType,
GraphQLCompositeType,
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
{
"Type": "AWS::Logs::SubscriptionFilter",
"DependsOn": "LoggingLambdaPermission",
"Properties": {
"LogGroupName": "LogGroup",
"FilterPattern": "{ $.HaHaThisIsJson NOT EXISTS }",
"DestinationArn": {
"Fn::GetAtt": [
"LoghandlerLambdaFunction",
"Arn"

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@notheotherben
notheotherben / README.md
Last active September 9, 2021 07:50
Fix Postgres 9.x Sequences

PostgreSQL 9.x Sequence Fixing Script

This script is intended to automatically fix the sequence numbers for all tables in the current database.

This is accomplished through the use of the setval() command, which we provide with the next ID value we wish to make use of. We use the setval(sequence, number, is_called) overload and set is_called = false in conjunction with COALESCE(MAX + 1, 1) to ensure that, with an empty table, the next sequence value is 1 as expected.