Skip to content

Instantly share code, notes, and snippets.

@mlinhard
mlinhard / docker_desc.sh
Last active April 19, 2024 15:53
Shell script to find docker image descendants
#!/bin/bash
parent_short_id=$1
parent_id=`docker inspect --format '{{.Id}}' $1`
get_kids() {
local parent_id=$1
docker inspect --format='ID {{.Id}} PAR {{.Parent}}' $(docker images -a -q) | grep "PAR ${parent_id}" | sed -E "s/ID ([^ ]*) PAR ([^ ]*)/\1/g"
}
print_kids() {
@vinicioslc
vinicioslc / flutter-android-cd.yml
Last active April 19, 2024 15:52
Build flutter releases in github actions for production only android for while.
# This is a basic workflow to help you get started with Actions
name: CD Internal-Lane
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
tags:
- "internal-v*.*.*" # on every version tag will build a new android artifact example: v3.1.2+6
jobs:
@hiaux0
hiaux0 / file-mime-types.ts
Last active April 19, 2024 15:46
Typescript Enum for file mime types
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
enum MimeTypes {
".aac" = "audio/aac",
".abw" = "application/x-abiword",
".arc" = "application/x-freearc",
".avi" = "video/x-msvideo",
".azw" = "application/vnd.amazon.ebook",
".bin" = "application/octet-stream",
".bmp" = "image/bmp",
@kabili207
kabili207 / Rclone systemd service.md
Last active April 19, 2024 15:44
Rclone systemd user service

rclone systemd service

Preparation

This service will use the same remote name you specified when using rclone config create. If you haven't done that yet, do so now.

Next, create the mountpoint for your remote. The service uses the location ~/mnt/<remote> by default.

mkdir ~/mnt/dropbox
@iotguider
iotguider / Interfacing_RGB_3_Color_LED_Module_KY-016_in_Raspberry_Pi.py
Created October 28, 2017 15:40
Code for Interfacing RGB 3 Color LED Module KY-016 in Raspberry Pi
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
RUNNING = True
green = 27
red = 17
blue = 22
@ingramchen
ingramchen / 00-ubuntu-intellij-macosx.md
Last active April 19, 2024 15:42
Use ubuntu/Intellij like macOS X

How to mimic full macOS Intellij behavior in Ubuntu

  • Enviroment
    • Ubuntu 20.04
    • Intellij IDEA 2020

Ubuntu gnome shell shortcuts

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 19, 2024 15:41
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@troyfontaine
troyfontaine / 1-setup.md
Last active April 19, 2024 15:41
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@kodekracker
kodekracker / draw_bounding_box_open_cv.py
Created June 20, 2018 18:31
To draw Bounding Box in a image using OpenCV python module
#!/usr/bin/env python
import cv2
import sys
def drawBoundingBoxes(imageData, imageOutputPath, inferenceResults, color):
"""Draw bounding boxes on an image.
imageData: image data in numpy array format
imageOutputPath: output image file path
inferenceResults: inference results array off object (l,t,w,h)
colorMap: Bounding box color candidates, list of RGB tuples.
@vasanthk
vasanthk / System Design.md
Last active April 19, 2024 15:40
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?