Skip to content

Instantly share code, notes, and snippets.

View nebgnahz's full-sized avatar

Ben Zhang nebgnahz

View GitHub Profile
@nebgnahz
nebgnahz / 1.Readme
Last active August 29, 2015 14:19
Add ProgressBar to Your Powerpoint Slides
After finish the slides,
1. Go to "Tools > Macro > Visual Basic Editor".
2. Then "Insert > Module" and copy code (2.ProgressBar) into the page.
3. Configure by changing the `Height`, `Color`, `Position` and `StartFrom` to your preference.
4. Then "Run > Run Sub/UserForm" will do the trick.
@nebgnahz
nebgnahz / keybase.md
Created January 4, 2016 23:45
keybase.md

Keybase proof

I hereby claim:

  • I am nebgnahz on github.
  • I am benzh (https://keybase.io/benzh) on keybase.
  • I have a public key whose fingerprint is 8FDE 454B 0A0B 8C7A 1550 E7B7 3C4D 172F 7E10 36DC

To claim this, I am signing this object:

@nebgnahz
nebgnahz / grt.rb
Last active May 7, 2016 18:40
GRT Brew Formula
class Grt < Formula
desc "The Gesture Recognition Toolkit (GRT) for Real-time machine learning."
homepage "http://www.nickgillian.com/wiki/"
url "https://github.com/nickgillian/grt/archive/v0.0.1.tar.gz"
sha256 "56f90a9ffa8b2bf4e5831d39f9e1912879cf032efa667a5237b57f68800a2dda"
depends_on "cmake" => :build
def install
cd "build"
@nebgnahz
nebgnahz / gstreamer.md
Last active November 6, 2023 12:28
Collections of GStreamer usages

Most GStreamer examples found online are either for Linux or for gstreamer 0.10.

This particular release note seems to have covered important changes, such as:

  • ffmpegcolorspace => videoconvert
  • ffmpeg => libav

Applying -v will print out useful information. And most importantly the negotiation results.

@nebgnahz
nebgnahz / CMakeLists.txt
Created July 26, 2016 22:40
Simple CMakeLists of using IMGUI on Mac OS (with GLFW)
cmake_minimum_required(VERSION 3.0.0)
set(PROJECT project-name)
project(${PROJECT})
set(SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
${CMAKE_CURRENT_SOURCE_DIR}/imgui.cpp
${CMAKE_CURRENT_SOURCE_DIR}/imgui_demo.cpp
${CMAKE_CURRENT_SOURCE_DIR}/imgui_draw.cpp
${CMAKE_CURRENT_SOURCE_DIR}/imgui_impl_glfw.cpp
@nebgnahz
nebgnahz / Images-Photos.md
Created August 4, 2016 23:45
Useful mac utilities for everyday tasks

Use sips to convert images from types to types and to the same resolution:

for i in *.tiff; do sips -z 600 600 -s format png $i --out converted/$i.png; done
@nebgnahz
nebgnahz / cblas-test.cpp
Created August 6, 2016 22:26
Use BLAS for matrix multiplication
#include <stdio.h>
#if __APPLE__
#include <Accelerate/Accelerate.h>
#elif __linux__
#include <cblas.h>
#endif
// Calculate a * b
float a[4][4] = {
@nebgnahz
nebgnahz / sd-dedup.sh
Created August 8, 2016 05:41
Clean up SDCard. I normally scan my photos with JPG because it's much faster to load. And I will make changes, delete bad ones, during the scan. In the end, I want the corresponding CR2 whose JPG counterparts have been removed being cleaned. This script does the job.
#!/bin/sh
set -e
cd /Volumes/CANON/DCIM/100CANON;
for f in *.CR2
do
b=$(basename $f .CR2)
if [ ! -f "/Volumes/CANON/DCIM/100CANON/$b.JPG" ]; then
rm $b.CR2
fi
@nebgnahz
nebgnahz / README.md
Created August 31, 2016 17:43
OpenCV __cg_jpeg_resync_to_restart
dyld: Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /usr/local/lib/libJPEG.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
error: Process didn't exit successfully: `target/debug/main` (signal: 5, SIGTRAP: trace/breakpoint trap)

Similarly for libTIFF.dylib, etc.

@nebgnahz
nebgnahz / README.md
Last active August 31, 2016 20:05
Deploy gh-pages

See deploy.sh.

Typical usage:

GIT_DEPLOY_DIR=<dir> GIT_DEPLOY_BRANCH=gh-pages deploy.sh -v

For ESP, I am using the following command: