Skip to content

Instantly share code, notes, and snippets.

@wvanderdeijl
wvanderdeijl / federation.md
Last active June 27, 2024 06:24
Google Cloud service account to AWS Role federation

Google Cloud service account to AWS Role federation

inspired by https://github.com/shrikant0013/gcp-aws-webidentityfederation

  1. create an AWS Role configured for Web Identity federation using Cognito or any OpenID provider
  2. select Google as the Identity provider in the wizard
  3. set the audience to a dummy value and do not add any additional conditions in the setup wizard. We will edit the trust policy after completing the wizard.
  4. assign any permissions needed to the role
  5. read up on "Available keys for AWS web identity federation" at
@akkornel
akkornel / id_token_demo.py
Created July 13, 2021 04:11
A Python 3.6+ script showing how to get an OpenID Connect Token from Google Auth, and comparing the one you get with your own OAuth2 client ID against the one you get with the Google Cloud SDK OAuth2 client ID
#!/usr/bin/env python3
# vim: ts=4 sw=4 et
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: MIT
# This was written by A. Karl Kornel <[email protected]>
# It is © The Board of Trustees of the Leleand Stanford Junior University
# It is made available under the MIT License
# https://opensource.org/licenses/MIT
@ryanpedersen42
ryanpedersen42 / config.yml
Last active May 8, 2024 13:00
Path filtering example
version: 2.1
setup: true
orbs:
path-filtering: circleci/[email protected]
workflows:
setup-workflow:
jobs:
@Zekfad
Zekfad / conventional-commits.md
Last active July 12, 2025 22:06
Conventional Commits Cheatsheet

Quick examples

  • feat: new feature
  • fix(scope): bug in scope
  • feat!: breaking change / feat(scope)!: rework API
  • chore(deps): update dependencies

Commit types

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • chore: Changes which doesn't change source code or tests e.g. changes to the build process, auxiliary tools, libraries
@artemious7
artemious7 / Serilog.LoggerStringInterpolationExtensions.cs
Last active May 26, 2024 08:56
C# Serilog: how to log with String interpolation and keep argument names in message templates
#region MIT License
//Copyright(c) 2020 Artemious
// https://gist.github.com/artemious7/c7d9856e128a8b2e9e92d096ca0e69ee/
// https://stackoverflow.com/questions/61816775/c-sharp-serilog-how-to-log-with-string-interpolation-and-keep-argument-names-in/61816776#61816776
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is

Pip is a package manager of python. You can download Python libraries from some Python repositories like PyPI. You can also download libraries from a git repository. This is gonna be the issue to be explained in this article.

I don't like to memorize things all the time. So, I guess, I couldn't be working without internet :). Whenever I need to install some python libraries from a git repositories, I see a lot of way to do it. It is really confusing. This should be the reason why I can't memorize it. I can see how a very simple requirement is handled with to many confusing way. There shouldn't be to many way. Some of them is not working neither. At last, I decided to blog it.

As you may know, you can use two protocols which are http and ssh to do something on git repositories. Using protocol ssh instead of http may provide some ease of use. Because of nature of ssh, you can do something with your primary/public keys. So, you don't have to input your credentials all the time. But I'll be

FROM php:7.2.19-cli
RUN set -eux; \
apt update; \
apt install --no-install-recommends unzip; \
rm -rf /var/lib/apt/lists/*; \
cd /usr/src; \
curl -o sqlite.zip https://www.sqlite.org/2017/sqlite-preprocessed-3200100.zip; \
unzip sqlite.zip; \
rm sqlite.zip; \
@swlaschin
swlaschin / FsCsInterop.md
Last active May 23, 2025 09:37
F# to C# interop tips

Tips on exposing F# to C#

Api and Methods

I suggest that you create one or more Api.fs files to expose F# code in a C# friendly way.

In this file:

  • Define functions with PascalCase names. They will appear to C# as static methods.
  • Functions should use tuple-style declarations (like C#) rather than F#-style params with spaces.
@clbarnes
clbarnes / classname.py
Created July 29, 2019 15:43
Get the fully-qualified class name of a python object
def classname(obj):
cls = type(obj)
module = cls.__module__
name = cls.__qualname__
if module is not None and module != "__builtin__":
name = module + "." + name
return name
@rafaelbeckel
rafaelbeckel / Eng-manager.md
Created May 3, 2019 02:43
Engineering Manager Role Description

From JimDabell's comment on Hacker News: https://news.ycombinator.com/item?id=18355568

Off the top of my head, these are the kinds of things engineering managers often have to deal with:

Hiring:

  • Writing job specs.
  • Dealing with recruiters
  • Reading CVs/résumés
  • Interviews