Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Furkan Üzümcü Furkanzmc

🏠
Working from home
View GitHub Profile
@Furkanzmc
Furkanzmc / multi_filename_replace.py
Last active Apr 20, 2017
Python Script to Replace the File Names in a Folder
View multi_filename_replace.py
#
# Python Script to Replace the File Names in a Folder
# Changes by @m-etka
#
import os
# Get working directory
path = os.getcwd()
@Furkanzmc
Furkanzmc / HttpCodes.h
Created Oct 10, 2016
HttpCodes enum for C++, extracted from https://httpstatuses.com/
View HttpCodes.h
#pragma once
enum HttpCodes {
// Informational
CONTINUE = 100,
SWITCHING_PROTOCOLS = 101,
PROCESSING = 102,
// Succcess
OK = 200,
CREATED = 201,
@Furkanzmc
Furkanzmc / TranslationHelper.cpp
Last active Dec 15, 2017
An example usage of QML internationalization and a helper C++ class
View TranslationHelper.cpp
#include "TranslationHelper.h"
#include <QGuiApplication>
#include <QTranslator>
TranslationHelper::TranslationHelper(QObject *parent)
: QObject(parent)
, m_Translator(new QTranslator(this))
, m_SourceLang("tr_TR")
, m_CurrentLang(m_SourceLang)
, m_TranslationsDir("translations")
@Furkanzmc
Furkanzmc / dateUtils.js
Created Mar 2, 2016
A couple of helper functions for Date operatipons in JavaScript
View dateUtils.js
Date.prototype.getWeekNumber = function() {
// Create a copy of this date object
var target = new Date(this.valueOf());
// ISO week date weeks start on monday, so correct the day number
var dauNumber = (this.getDay() + 6) % 7;
// Set the target to the thursday of this week so the
// target date is in the right year
target.setDate(target.getDate() - dauNumber + 3);
// ISO 8601 states that week 1 is the week with january 4th in it
@Furkanzmc
Furkanzmc / BodyTracking.cpp
Last active Jul 18, 2019
Body Tracking with Kinect v2 C++
View BodyTracking.cpp
#include <Kinect.h>
#include <iostream>
void processBodies(const unsigned int &bodyCount, IBody **bodies);
template<class Interface>
static inline void safeRelease(Interface *&interfaceToRelease)
{
if (interfaceToRelease != nullptr) {
interfaceToRelease->Release();
interfaceToRelease = nullptr;
View Onename Verification.txt
Verifying that +furkanzmc is my blockchain ID. https://onename.com/furkanzmc
@Furkanzmc
Furkanzmc / FindKinectSDKv2.cmake
Created May 22, 2015
Cmake file to find Kinect SDK v2 library on Windows
View FindKinectSDKv2.cmake
set(KinectSDK2_FOUND OFF CACHE BOOL "Kinect 2.x SDK found")
set(KINECTSDK20_DIR "NOT FOUND" CACHE PATH "Kinect 2.x SDK path")
if(WIN32)
if(EXISTS $ENV{KINECTSDK20_DIR})
message(KINECT_FOUND)
set(KinectSDK2_FOUND ON CACHE BOOL "Kinect 2.x SDK found" FORCE)
set(KinectSDK2_DIR $ENV{KinectSDK2_DIR} CACHE PATH "Kinect 2.x SDK path" FORCE)
if(EXISTS $ENV{KINECTSDK20_DIR}/inc)
set(KinectSDK2_INCLUDE_DIRS $ENV{KINECTSDK20_DIR}/inc)
@Furkanzmc
Furkanzmc / VSyncForCocos2dX.cpp
Last active Aug 29, 2015 — forked from daltondotgd/VSyncForCocos2dX.cpp
To enable VSync for WIN32 in cocos2d-x, modify initWithRect(...) function in CCGLView.cpp, so it contains this code right before 'initGlew();'
View VSyncForCocos2dX.cpp
...
...
...
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
// Turn on vertical screen sync under Windows.
// (I.e. it uses the WGL_EXT_swap_control extension)
typedef BOOL(WINAPI *PFNWGLSWAPINTERVALEXTPROC)(int interval);
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = NULL;
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress("wglSwapIntervalEXT");
View WrapLabelText.cpp
void adjustFontSize(Label *label, const float &desiredSize)
{
std::string str = label->getString();
const float estimatedCharSize = label->getBoundingBox().size.width / label->getStringLength();
const float columnNumberToWrap = desiredSize / estimatedCharSize;
const float numberOfTimesToWrap = label->getBoundingBox().size.width / desiredSize;
for (int i = 1; i < numberOfTimesToWrap; i++) {
const int index = columnNumberToWrap * i;
std::string splitter = std::isspace(str.at(index)) ? "\n" : "-\n";
@Furkanzmc
Furkanzmc / OpenBR.sh
Created Jul 12, 2014
OpenBR Cmake Command Parameters
View OpenBR.sh
C:\Program Files (x86)\CMake\bin\cmake.exe -G "Visual Studio 12 2013" -DCMAKE_PREFIX_PATH="D:/OpenCV/build;C:/Qt/Qt5.3.1/5.3/msvc2013" -DCMAKE_INSTALL_PREFIX="./install" -DBR_INSTALL_DEPENDENCIES=ON -DCMAKE_BUILD_TYPE=Release ..