Skip to content

Instantly share code, notes, and snippets.

View xu-chris's full-sized avatar
🕳️

Chris Xu xu-chris

🕳️
  • d.vinci HR-Systems
  • Hamburg
View GitHub Profile
@xu-chris
xu-chris / converter.py
Created February 19, 2022 13:31 — forked from Kronopath/converter.py
WeChat audio converter script. See http://kronopath.net/blog/extracting-audio-messages-from-wechat/ for more details.
# WeChat aud file converter to wav files
# Dependencies:
# SILK audio codec decoder (available at https://github.com/gaozehua/SILKCodec)
# ffmpeg
#
# By Gabriel B. Nunes (gabriel@kronopath.net)
# Adapted from another script by Nicodemo Gawronski (nico@deftlinux.net)
#
import os, argparse, subprocess
image:
[]
detections:
-
box: [50.07582092285156, 355.50042724609375, 537.6442260742188, 536.150390625]
score: 0.452870070934
class_str: "0"
---
import os
import glob
def get_image_paths(path):
# Gather image paths
image_paths = glob.iglob(os.path.join(path, "*.png"))
# Loop through images, skip those without bounding boxes
for image_path in image_paths:
# Add key of ros repo
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
# Add ros repo
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
# Install ros
sudo apt update
sudo apt install -y ros-kinetic-desktop-full
apt search ros-kinetic
# install ros dependency
# Add ros repo
# Add key of ros repo
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
# Install ros
sudo apt update
sudo apt install ros-melodic-desktop-full
apt search ros-melodic
# install ros dependency
sudo rosdep init
on run argv
tell application "System Events"
tell appearance preferences
set dark mode to not dark mode
end tell
end tell
@xu-chris
xu-chris / LowBatteryPercentage.sh
Last active January 29, 2018 21:23
Return true when Mac battery percentage is under 10 percent
#!/bin/sh
# Use this shell script in combination with ControlPlane (http://www.controlplaneapp.com) to detect
# and automatize when the battery percentage is lower or equal than 10 percent.
# For example: let ControlPlane close for you all Cloud applications when you to low battery life.
batteryPercentage=`pmset -g batt | egrep -ow '([0-9]{1,3})[^%]'`
lowbatPercentage=10
if [ ${batteryPercentage} -le ${lowbatPercentage} ]; then
<?php
/**
* Move this file to /site/tags/ and rename it image.php
*/
/**
* @param array['width'] Width in pixel of the image. When crop/resize active, this is the new image width. Default: null
* @param array['height'] Height in pixel of the image. When crop/resize active, this is the new image height. Default: null
* @param array['alt']
@xu-chris
xu-chris / gist:0a581de896c30029d766
Last active August 29, 2015 14:12
Using search() for kellertheater.de
// Finds the specific description page for a play in 'repertoire'
function findDescriptionPage($name, $pages) {
// Break Conditions
if (empty($name) || empty($pages) || $pages->find('repertoire') == false) return false;
// First round: exact matches
if($result = $pages->find('repertoire')->children()->visible()->search($name, 'title|label|author|uid')) return $result;
}
@xu-chris
xu-chris / gist:4598c67aff97fc89e913
Last active August 29, 2015 14:12
FontAwesome 4.2 shortened SCSS with @each
// Font Icon
%fontawesomeIcon {
display: inline-block;
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}