Skip to content

Instantly share code, notes, and snippets.

View ttruongatl's full-sized avatar
🏠
Working from home

ttruongatl ttruongatl

🏠
Working from home
View GitHub Profile
@ttruongatl
ttruongatl / master-javascript-interview.md
Created April 25, 2018 06:24 — forked from Geoff-Ford/master-javascript-interview.md
Eric Elliott's Master the JavaScript Interview Series
@ttruongatl
ttruongatl / ARKit-ARFrame-Opencv.mm
Last active April 3, 2023 14:03
fix padding image
// The Y plane represents the luminance component, and the UV plane represents the Cb and Cr chroma components.
// In the case of kCVPixelFormatType_420YpCbCr8BiPlanarFullRange format, you will find the luma plane is 8bpp with the same dimensions as your video, your chroma plane will be 16bpp, but only a quarter of the size of the original video. You will have one Cb and one Cr component per pixel on this plane.
// so if your input video is 352x288, your Y plane will be 352x288 8bpp, and your CbCr 176x144 16bpp. This works out to be about the same amount of data as a 12bpp 352x288 image, half what would be required for RGB888 and still less than RGB565.
// So in the buffer, Y will look like this [YYYYY . . . ] and UV [UVUVUVUVUV . . .]
// vs RGB being, of course, [RGBRGBRGB . . . ]
// https://stackoverflow.com/questions/13429456/how-seperate-y-planar-u-planar-and-uv-planar-from-yuv-bi-planar-in-ios
#pragma ARSessionDelegate
- (void)session:(ARSession *)session didUpdateFrame:(ARFrame *)frame{
CVPixelBuff
@ttruongatl
ttruongatl / dynamodb_rename_attribute.py
Created January 12, 2021 12:12 — forked from brettfreer/dynamodb_rename_attribute.py
Rename an AWS dynamodb table attribute with an exponential timing backoff
#!/usr/bin/env python3
""" Rename an AWS dynamodb table attribute with an exponential timing back-off
"""
import logging
from time import sleep
import boto3
from boto3.dynamodb.conditions import Attr