Skip to content

Instantly share code, notes, and snippets.

View kennychufk's full-sized avatar

Kinfung Chu (Kenny) kennychufk

View GitHub Profile
@eyalroz
eyalroz / get_cuda_sm.sh
Created April 15, 2017 20:28
Shell script for determining the SM value for your (single) GPU
#!/bin/bash
#
# Prints the compute capability of the first CUDA device installed
# on the system, or alternatively the device whose index is the
# first command-line argument
device_index=${1:-0}
timestamp=$(date +%s.%N)
gcc_binary=${CMAKE_CXX_COMPILER:-$(which c++)}
cuda_root=${CUDA_DIR:-/usr/local/cuda}
@ds26gte
ds26gte / protectterm.vim
Last active April 29, 2024 10:09
Don't kill terminal buffers inadvertently when exiting Neovim
" Last modified 2017-11-30
" Dorai Sitaram
" By default, Neovim warns you only of unsaved file buffers
" before you exit, not of unclosed terminal buffers, which will
" be summarily killed. Unintentionally killing a terminal buffer
" can be frustrating, not only because of killed processes (which
" could be restarted) but also for the lost scroll history. This
" plugin prevents that loss.
@ALevitskyy
ALevitskyy / extrinsic_to_blender.py
Created November 5, 2019 01:03
Convert CV2 extrinsic to Blender camera.object.location and camera.object.rotation_euler parameters
import math
import cv2
import numpy as np
def isRotationMatrix(R):
Rt = np.transpose(R)
shouldBeIdentity = np.dot(Rt, R)
I = np.identity(3, dtype=R.dtype)
n = np.linalg.norm(I - shouldBeIdentity)