Skip to content

Instantly share code, notes, and snippets.

View menzenski's full-sized avatar

Matt Menzenski menzenski

View GitHub Profile
@usr-ein
usr-ein / Dockerfile
Last active July 12, 2024 08:39
Optimal multistaged Dockerfile for poetry
# syntax=docker/dockerfile:1
# Keep this syntax directive! It's used to enable Docker BuildKit
# Based on https://github.com/python-poetry/poetry/discussions/1879?sort=top#discussioncomment-216865
# but I try to keep it updated (see history)
################################
# PYTHON-BASE
# Sets up all our shared environment variables
################################
@nodefortytwo
nodefortytwo / dazn-manifest330-schema.json
Created February 23, 2022 11:19
DAZN Manifest Public 330 Schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://dazn.com/manifest.schema.json",
"title": "dazn-manifest",
"type": "object",
"additionalProperties": false,
"description": "A YAML file which describes the contents of a code repository in a machine readable format.",
"properties": {
"dazn-manifest": {
"title": "version",
@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active July 22, 2024 22:01
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@jgontrum
jgontrum / jwt_fast_api.py
Created August 29, 2019 12:21
JWT & FastAPI
import os
from typing import Dict, List, Optional
import requests
from jose import jwt, jwk
from jose.utils import base64url_decode
JWK = Dict[str, str]
JWKS = Dict[str, List[JWK]]
@stefanthoss
stefanthoss / export-pyspark-schema-to-json.py
Created June 19, 2019 22:16
Export/import a PySpark schema to/from a JSON file
import json
from pyspark.sql.types import *
# Define the schema
schema = StructType(
[StructField("name", StringType(), True), StructField("age", IntegerType(), True)]
)
# Write the schema
with open("schema.json", "w") as f:
title date tags categories
How to get started to build your own Spacemacs
2018-10-12 12:59
emacs
Tools

I have been a Vim user for quite a while. I love it, so the very first thing when I set up a new server is installing VIM. I heard a lot about Emacs and tried it. It's better at almost everything except text editing. So I stayed with Vim until Spacemacs was released. The Vim key bindings of Spacemacs is so excellent that I switched.

However, Spacemacs has its problem: boots up slowly and crashes frequently. Upgrading packages became very challenging. Finally, I have to use the develop branch because the master branch is not working anymore. People began to complain and requested to speed up the release from the master branch. Considering its dependencies and numerous open issues, I have no hope for this.

@magicdude4eva
magicdude4eva / zsh-syntax-highlighting paste performance improvement
Last active July 1, 2024 15:05
zsh-syntax-highlighting paste performance improvement
Add the following in .zshrc:
...
plugins=(osx git zsh-autosuggestions zsh-syntax-highlighting zsh-nvm docker kubectl)
...
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active July 23, 2024 00:25
set -e, -u, -o, -x pipefail explanation
@clrcrl
clrcrl / test_unnest_delimited_list.sql
Last active February 4, 2023 04:59
Macros to unnest arrays
-- this is a model - put it in the models/ directory
WITH nested_table AS (
SELECT 1 AS id, 'a' AS tags
UNION
SELECT 2 AS id, 'a, b' AS tags
UNION
SELECT 3 AS id, 'c , d' AS tags
UNION
SELECT 4 AS id, 'a,b,e' AS tags
UNION
@shortjared
shortjared / list.txt
Last active July 19, 2024 21:20
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com