Skip to content

Instantly share code, notes, and snippets.

View ai2ys's full-sized avatar
🎯
Focusing

Sylvia Schmitt ai2ys

🎯
Focusing
View GitHub Profile
@aaalexlit
aaalexlit / create-infra.sh
Last active November 29, 2023 12:33
Create a Lambda function with an ML model and expose it to the internet through AWS API Gateway. After finishing, clean it up running ./delete-infra.sh
# Check if the number of arguments is correct
if [ "$#" -ne 1 ]; then
echo "Usage: $0 local_image_name"
exit 1
fi
# Assign the argument to a variable
LOCAL_IMAGE_NAME=$1
@ai2ys
ai2ys / rebase-instead-of-merge.md
Last active December 24, 2023 21:29
Rebase instead of Merge
@marcoandre1
marcoandre1 / SSH-configuration-github-gitlab.md
Last active April 17, 2024 14:51
Managing SSH keys for Github and Gitlab

Managing SSH keys for Github and Gitlab

NOTICE: This guide will help you set ssh keys for GitHub and GitLab. However, this is not going to change your commit user.name or user.email. If you need to change those for specific repositories, just run the following commands while in your repository:

git config user.name "Your Name Here"
git config user.email your@email.com

For more info, see this answer. Also, keep in mind this only changes the .git folder inside your repository which never gets added/committed/pushed/uploaded.

I recently had to manage two ssh keys (one for Github and one for Gitlab). I did some research to find the best solution. I am justing putting the pieces together here.

@wildestpixel
wildestpixel / code.py
Last active July 17, 2022 23:43
Raspberry Pi Pico & Pimoroni RGB Keypad HID in Circuitpython 6.2+
# Adapted from Sandy J Macdonald's gist at https://gist.github.com/sandyjmacdonald/b465377dc11a8c83a8c40d1c9b990a90 to configure all buttons and switch off all lights in loop
import time
import board
import busio
import usb_hid
from adafruit_bus_device.i2c_device import I2CDevice
import adafruit_dotstar
# !/usr/bin/env python
import tensorflow as tf
from tensorflow.python.framework.convert_to_constants import convert_variables_to_constants_v2_as_graph
from tensorflow.lite.python.util import run_graph_optimizations, get_grappler_config
from pathlib import Path
import argparse
def frozen_keras_graph(model):
@kiding
kiding / HDRGainMap.swift
Last active April 2, 2024 08:32
Extracting HDR Gain Map from iOS 14.1+ (iPhone 12+) photos
import UIKit
import MobileCoreServices.UTCoreTypes
if #available(iOS 14.1, *) {
let input = Bundle.main.url(forResource: "IMG_0037", withExtension: "HEIC")!
let output = FileManager().temporaryDirectory.appendingPathComponent("IMG_0037.GAIN_MAP.BMP")
let source = CGImageSourceCreateWithURL(input as CFURL, nil)!
// urn:com:apple:photo:2020:aux:hdrgainmap
let dataInfo = CGImageSourceCopyAuxiliaryDataInfoAtIndex(source, 0, kCGImageAuxiliaryDataTypeHDRGainMap)! as Dictionary
@RaphaelMeudec
RaphaelMeudec / grad_cam.py
Created July 18, 2019 15:11
Grad CAM implementation with Tensorflow 2
import cv2
import numpy as np
import tensorflow as tf
IMAGE_PATH = './cat.jpg'
LAYER_NAME = 'block5_conv3'
CAT_CLASS_INDEX = 281
img = tf.keras.preprocessing.image.load_img(IMAGE_PATH, target_size=(224, 224))
img = tf.keras.preprocessing.image.img_to_array(img)
@aharonamir
aharonamir / launch.json
Created June 21, 2018 14:29
debug config
{
"version": "0.2.0",
"configurations": [
{
"name": "C++ Launch (GDBSERVER)",
"type": "cppdbg",
"request": "launch",
"miDebuggerServerAddress": "localhost:2000",
"preLaunchTask": "start-gdbserver",
@aharonamir
aharonamir / tasks.json
Created June 21, 2018 14:17
vscode tasks
{
"version": "2.0.0",
"tasks": [
{
"label": "start develop env",
"type": "shell",
"command": "docker-compose -f develop-compose.yml run --service-ports --name devenv dev-image bash",
"problemMatcher": []
},
{
@aharonamir
aharonamir / develop-compose.yml
Created June 21, 2018 14:06
develop compose file
version: '2'
services:
##### the develop image you've build
### don't forget to open ports for your app
dev-image:
image: your-company/your-project/develop
ports:
- "2000:2000"
- "50010:50010"
privileged: true