Skip to content

Instantly share code, notes, and snippets.

View DarkSector's full-sized avatar
🎯
Focusing

Pronoy Chopra DarkSector

🎯
Focusing
View GitHub Profile
@DarkSector
DarkSector / hyperpod-precheck.py
Last active February 26, 2024 19:14
Check Hyperpod runtime or parse training script for non-supported parameters.
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import os
import re
import sys
import json
import socket
import pathlib
@DarkSector
DarkSector / cognito-change-password-challenge.py
Created February 20, 2022 07:59 — forked from tuliocasagrande/cognito-change-password-challenge.py
Responds to the new password challenge on Amazon Cognito
import boto3
def generate_password(length=16):
"""Generate a random alphanumeric password.
More recipes and best practices can be found here:
https://docs.python.org/3/library/secrets.html#recipes-and-best-practices.
Args:
@DarkSector
DarkSector / build.sh
Created November 10, 2021 03:35
OpenCV camera video example
g++ cv_example.cpp -I/usr/local/msquic/include -L/usr/local/msquic/lib -I/usr/include/opencv4 -lopencv_core -lopencv_highgui -lopencv_videoio
@DarkSector
DarkSector / nato.json
Created August 7, 2020 06:10 — forked from zekesonxx/nato.json
NATO Phonetic Alphabet in JSON. Just in case someone needs it.
{
"A": "Alfa",
"B": "Bravo",
"C": "Charlie",
"D": "Delta",
"E": "Echo",
"F": "Foxtrot",
"G": "Golf",
"H": "Hotel",
"I": "India",
@DarkSector
DarkSector / Makefile
Created July 27, 2020 10:54 — forked from holachek/Makefile
AVR Tutorial Makefile
# Name: Makefile
# Author: <insert your name here>
# Copyright: <insert your copyright message here>
# License: <insert your license reference here>
# DEVICE ....... The AVR device you compile for
# CLOCK ........ Target AVR clock rate in Hertz
# OBJECTS ...... The object files created from your source files. This list is
# usually the same as the list of source files with suffix ".o".
# PROGRAMMER ... Options to avrdude which define the hardware you use for
@DarkSector
DarkSector / python_decorator_guide.md
Created May 19, 2020 22:07 — forked from Zearin/python_decorator_guide.md
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].

@DarkSector
DarkSector / unfollow-all.md
Created May 4, 2020 06:51 — forked from xeloader/unfollow-all.md
Unfollow everyone on LinkedIn

Unfollow everyone on Social Media

Unfollow everyone on LinkedIn

LinkedIn is even more clickbait than Facebook nowadays. Adios. 💣

Visit https://www.linkedin.com/feed/following/

Scroll down to load all of your contacts

Open developer console, run the following

@DarkSector
DarkSector / client.rs
Last active April 16, 2020 08:26
Supervisor - Client actor system
use std::panic;
use std::sync::{Arc, Mutex};
use std::thread;
use std::time::Duration;
use actix::io::SinkWrite;
use actix::*;
use actix_codec::Framed;
use awc::{
error::WsProtocolError,
@DarkSector
DarkSector / iterm2-solarized.md
Created April 12, 2020 08:02 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@DarkSector
DarkSector / mapDispatchToProps
Created April 10, 2019 18:49
mapDispatchToProps with Arguments
const mapDispatchToProps = (dispatch, ownProps) => {
return {
executeCapability,
loadConfig: (name, capabilityName) => dispatch(loadConfig(name, capabilityName))
}
}
export default connect(mapStateToProps, mapDispatchToProps)(Capability)