This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Get the substring to replace and the replacement string | |
read -p "Enter substring to replace: " old_string | |
read -p "Enter replacement string: " new_string | |
# Function to rename files recursively | |
rename_files () { | |
for filename in *; do | |
# Check if filename contains the old string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i my-movie.mov -ss 00:00:00 -filter_complex "[0:v] fps=12,scale=1024:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" output.gif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func withTimeout(ctx context.Context, f func(context.Context) error) error { | |
c := make(chan error, 1) | |
go func() { c <- f(ctx) }() | |
select { | |
case <-ctx.Done(): | |
return ctx.Err() | |
case err := <-c: | |
return err | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Exit immediately for non zero status | |
set -e | |
# Check unset variables | |
set -u | |
# Print commands | |
set -x | |
# Prevent acciedently running as root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import numpy as np | |
import cv2 | |
import time | |
np.set_printoptions(formatter={'float': '{: 0.3f}'.format}) | |
def triangulate_nviews(P, ip): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from picamera.array import PiRGBArray | |
from picamera import PiCamera | |
import time | |
import sys | |
import numpy as np | |
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages') | |
import cv2 | |
import cv2.aruco as aruco | |
import numpy as np | |
import rectangleArea as ra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <opencv2/opencv.hpp> | |
#include <pcl/common/common_headers.h> | |
#include <pcl/io/pcd_io.h> | |
#include <pcl/point_types.h> | |
#include <pcl/point_cloud.h> | |
#include <pcl/visualization/pcl_visualizer.h> | |
#include <Eigen/Core> | |
#include <Eigen/LU> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type EnumNames = 'A' | 'B' | 'C'; | |
export type EnumMap<K: string, V, O: Object = *> = O & { | |
[K]: V & $ElementType<O, K>, | |
}; | |
export type SpecificMap = EnumMap<EnumNames, any>; | |
const cbNames: EnumMap<EnumNames, (any) => void> = { | |
A: v => v, | |
B: v => v.prop, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python | |
Python 2.7.16 (default, Apr 12 2019, 15:32:40) | |
[GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.3)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import this | |
The Zen of Python, by Tim Peters | |
Beautiful is better than ugly. | |
Explicit is better than implicit. | |
Simple is better than complex. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const useForceRender = () => { | |
const [, forceRender] = useReducer((oldVal) => oldVal + 1, 0) | |
return forceRender | |
} |
NewerOlder