Skip to content

Instantly share code, notes, and snippets.

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

Shin shinshiner

🏠
Working from home
View GitHub Profile
@shinshiner
shinshiner / .bash_aliases
Created September 29, 2018 08:30 — forked from vratiu/.bash_aliases
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@shinshiner
shinshiner / depth_to_pcd.py
Last active September 29, 2021 09:11
Convert depth map to point cloud in Mujoco 1.50
import numpy as np
def depth2pcd(depth):
def remap(x, in_range_l, in_range_r, out_range_l, out_range_r):
return (x - in_range_l) / (in_range_r - in_range_l) * (out_range_r - out_range_l) + out_range_l
# depth = remap(depth, depth.min(), depth.max(), 0, 1)
# print(depth)
scalingFactor = 1
fovy = 60
@shinshiner
shinshiner / git_dss.sh
Created August 31, 2018 03:10
Proxy settings for git command
#!/bin/sh
git config --global unset http.proxy
git config --global unset https.proxy
@shinshiner
shinshiner / clean_disk.py
Created August 31, 2018 01:47
A small script to clean your disk, preventing data recovery
import os
import time
total = 80 # the number of copied files, decided by your free disk space
times = 2 # clean times, the more, the better
big_file = 'xxx' # a big file, maybe a .zip file or others ...
for j in range(times):
for i in range(total):
tgt_path = '%03d' % i
@shinshiner
shinshiner / quaternion.py
Last active August 1, 2018 09:52
四元数和其余旋转方式的转换
from math import *
def angleaxis_to_quat(rot, theta):
# rot: [rx, ry, rz]
return [r * sin(theta / 2) for r in rot] + [cos(theta / 2)]
def euler_to_quat(euler):
# euler: [X, Y, Z]