Skip to content

Instantly share code, notes, and snippets.

View adderly's full-sized avatar

Adderly adderly

View GitHub Profile
# function processes each sub-directory and then adds each source file in directory
# each function should cascade back upward in setting variables so that the bottom directory
# adds its source first, and then the level above it adds its source and passes both up, and so on...
function( recursively_include_src which_directory return_variable )
if( ${return_variable} STREQUAL "headers" )
set( file_extension ".h" )
else( ${return_variable} STREQUAL "headers" )
set( file_extension ".c" )
endif( ${return_variable} STREQUAL "headers" )
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 13, 2024 14:35
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@KartikTalwar
KartikTalwar / Documentation.md
Last active June 25, 2024 10:55
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
OS=`echo \`uname\` | tr '[:upper:]' '[:lower:]'`
AURL="https://gist.githubusercontent.com/hightemp/5071909/raw/"
ANAME=".bash_aliases"
TMPAPATH="/tmp/$ANAME"
HOMEAPATH="~/$ANAME"
[ "$OS" = "windowsnt" ] && OS_WIN="yes"
[ "$OS" = "darwin" ] && OS_MAC="yes"
[ "$OS" = "linux" ] && OS_LIN="yes"
@jtdp
jtdp / gist:5443498
Last active May 23, 2024 16:23
Revert file permission changes in local git repository.. Very useful when you change permissions due to working on a samba share. Lifted from: http://stackoverflow.com/questions/2517339/git-how-to-recover-the-file-permissions-git-thinks-the-file-should-be
git diff -p \
| grep -E '^(diff|old mode|new mode)' \
| sed -e 's/^old/NEW/;s/^new/old/;s/^NEW/new/' \
| git apply
@fenbf
fenbf / glParticleRenderer.cpp
Last active February 4, 2018 00:02
particle rendering 'system'.
#include "glParticleRenderer.h"
#include "particles.h"
#include <assert.h>
#include "gl_includes.h"
namespace particles
{
void GLParticleRenderer::generate(ParticleSystem *sys, bool)
{
Component {
id: reusableComponent
Item {
property string value: "Hello"
}
}
property Item itemA: reusableComponent.createObject(this)
property Item itemB: reusableComponent.createObject(this)
Text {
@tzutalin
tzutalin / build-android-opencv.sh
Last active October 1, 2022 21:18
Build OpenCV for android
#!/usr/bin/env sh
NDK_ROOT="${1:-${NDK_ROOT}}"
if [ ! -d "${WD}/android-cmake" ]; then
echo 'Cloning android-cmake'
git clone https://github.com/taka-no-me/android-cmake.git
fi
### ABI setup
#ANDROID_ABI=${ANDROID_ABI:-"armeabi-v7a with NEON"}