Skip to content

Instantly share code, notes, and snippets.

View AhiyaHiya's full-sized avatar

Jaime AhiyaHiya

View GitHub Profile
@AhiyaHiya
AhiyaHiya / Makefile.osx
Last active December 14, 2015 15:09
FreeImage Makefile for Mac OS X. The original file came from https://gist.github.com/joonyou/1595931 , but I modified the file to work with the 10.10 SDK located within Xcode 6.3.2 running on Mac OS X 10.10
# -*- Makefile -*-
# Mac OSX makefile for FreeImage
# This file can be generated by ./gensrclist.sh
include Makefile.srcs
# General configuration variables:
CC_X86_64 = clang
CPP_X86_64 = clang++
COMPILERFLAGS = -Os -fexceptions -fvisibility=hidden -DNO_LCMS -D__ANSI__ -DDISABLE_PERF_MEASUREMENT
@AhiyaHiya
AhiyaHiya / ConvertCVMatToWin32BMP.cpp
Last active February 6, 2022 21:56
Function to convert cv::Mat to Win32 HBITMAP aka BMP; function to paste HBITMAP to Windows clipboard.
#include <cassert>
#include "opencv2/opencv.hpp"
auto ConvertCVMatToBMP (cv::Mat frame) -> HBITMAP
{
auto convertOpenCVBitDepthToBits = [](const int32_t value)
{
auto regular = 0u;
@AhiyaHiya
AhiyaHiya / .clang-format-cpp
Last active June 5, 2019 19:34
The clang-format file I use on my C++ files.
Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlinesLeft: false
AlignOperands: true
@AhiyaHiya
AhiyaHiya / sublime-keystroke-xcode-settings.txt
Last active October 28, 2016 04:53
Sublime keystroke settings to have the same mappings as Xcode
[
{ "keys": ["super+shift+["], "command": "prev_view" },
{ "keys": ["super+shift+]"], "command": "next_view" },
{ "keys": ["super+alt+left"], "command": "fold" },
{ "keys": ["super+alt+right"], "command": "unfold" },
{ "keys": ["super+alt+["], "command": "swap_line_up" },
{ "keys": ["super+alt+]"], "command": "swap_line_down" },
/*
Losely based on http://stackoverflow.com/questions/18154630/c-see-if-argument-is-numeric
and other related answers on stackoverflow.com
*/
auto IsNumber(const std::string& maybeNumber) -> bool
{
auto decimal = false;
for (char c : maybeNumber)
{
if (c == '.' && !decimal)
# script expects to be at the root folder where ROSE was already downloaded
# so if you:
# mkdir ROSE
# cd ROSE
# git clone https://github.com/rose-compiler/rose .
# This script should be in the ROSE folder
set -o errexit
set -o pipefail
set -o nounset
@AhiyaHiya
AhiyaHiya / .shared_aliases
Last active November 17, 2017 15:53
My favorites aliases for both bash and zsh (oh my zsh)
#
# For both zsh and bash
#
#####################
# Cool terminal notification app but message only works with single quote
alias tnot="terminal-notifier -message "
#####################
# clang-format
#!/bin/bash
set -o errexit
set -o pipefail
set -o nounset
# Inspired by
# https://github.com/mgrebenets/boost-xcode5-iosx/blob/master/boost.sh
download_boost() {
printf "*********************************\\n%s\\n" "${FUNCNAME[0]}"
set -o nounset
SetupCatch()
{
printf "*********************************\n${FUNCNAME[0]}\n"
if [[ ! -d components/catch/ ]]; then
mkdir -p components/catch/include/
cd components/catch/include/
set -o nounset
SetupIntelTBB()
{
printf "*********************************\n${FUNCNAME[0]}\n"
if [[ ! -d $CURRENT_PATH/components/intel/tbb ]]; then
mkdir -p $CURRENT_PATH/components/intel/tbb
fi