Skip to content

Instantly share code, notes, and snippets.

@andycmaj
andycmaj / karabiner-elements-remote-desktop.json
Created November 6, 2021 19:04 — forked from DennyWeinberg/rdp.json
Karabiner Elements JSON configuration for Microsoft Remote Desktop
{
"title": "Microsoft Remote Desktop",
"rules": [
{
"description": "Windows Mappings",
"manipulators": [
{
"type": "basic", "description": "Completely disabled the windows key (Startmenu)",
"from": { "key_code": "left_command" },
"to": [ { "key_code": "left_control" } ],
@kaaquist
kaaquist / podman_macos.md
Last active May 4, 2024 22:37
Podman with docker-compose on MacOS.

Podman with docker-compose on MacOS.

Podman an alternative to Docker Desktop on MacOS

Getting podman installed and started is super easy.
Just use brew to install it.

> brew install podman

Now since podman uses a VM just like the Docker Client on MacOS we need to initialize that and start it.

@UrsaDK
UrsaDK / Caching multi-stage builds in GA.md
Last active March 28, 2024 07:16
Speed up your multistage builds in GitHub Actions

Caching multi-stage builds in GitHub Actions

Caching Docker builds in GitHub Actions is an excellent article by @dtinth which analyses various strategies for speeding up builds in GitHub Actions. The upshot of the article is a fairly decisive conclusion that the best two ways to improve build times are:

  1. Build images via a standard docker build command, while using GitHub Packages' Docker registry as a cache = Longer initial build but fastest re-build times.

  2. Build your images via docker integrated BuildKit (DOCKER_BUILDKIT=1 docker build), while using a local registry and actions/cache to persist build caches = Fastest initial build but slightly longer re-build times.

The problem

import { ApolloClient, QueryOptions, MutationOptions } from 'apollo-client';
import { DocumentNode } from 'graphql';
import { getSdk, Requester } from '.generated/schema-typedefs';
import { ApolloRequestError } from './ApolloRequestError';
export type ApolloRequesterOptions<V, R> =
| Omit<QueryOptions<V>, 'variables' | 'query'>
| Omit<MutationOptions<R, V>, 'variables' | 'mutation'>;
@mayneyao
mayneyao / notion2blog.js
Last active February 29, 2024 18:01
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
@heygrady
heygrady / mapDispatchToProps.md
Last active September 16, 2023 19:19
Redux containers: mapDispatchToProps

Redux containers: mapDispatchToProps

This document details some tips and tricks for creating redux containers. Specifically, this document is looking at the mapDispatchToProps argument of the connect function from [react-redux][react-redux]. There are many ways to write the same thing in redux. This gist covers the various forms that mapDispatchToProps can take.

@troyharvey
troyharvey / deployment.yml
Last active February 27, 2024 04:47
Using Kubernetes envFrom for environment variables
# Use envFrom to load Secrets and ConfigMaps into environment variables
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: mans-not-hot
labels:
app: mans-not-hot
spec:
replicas: 1
@andycmaj
andycmaj / cloudSettings
Last active June 14, 2021 01:27
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-06-14T01:27:01.847Z","extensionVersion":"v3.4.3"}
@cantremember
cantremember / nginx-ws-tls-termination.conf
Created April 30, 2017 20:21
Nginx as a TLS Termination proxy for WebSockets
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream server_cluster {
# sticky connections are critical for non-WebSocket Socket.io
# http://socket.io/docs/using-multiple-nodes/
ip_hash;
from alpine:edge
env DOWNLOAD_DIR=/usr/local/build
run mkdir -p $DOWNLOAD_DIR
workdir $DOWNLOAD_DIR
copy ./add_alpine.patch ./
run echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
run apk update \
&& apk add bash musl-dev openssl cmake make llvm clang clang-dev gettext-dev \
python util-linux-dev icu-dev lldb-dev@testing libunwind-dev \
lttng-ust-dev@testing binutils gcc git build-base \