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 / 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;
@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 / 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 / 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 / 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 / youtubedl-download.bash
Created Apr 18, 2018
Download YouTube Videos from Text File
View youtubedl-download.bash
while read p; do youtube-dl --no-check-certificate -x --audio-format mp3 --audio-quality 1 $p; done <Nightcore.txt
@Furkanzmc
Furkanzmc / astyle.txt
Last active May 11, 2018
My favorite astyle configuration
View astyle.txt
--align-pointer=name
--align-reference=name
--convert-tabs
--mode=c
--pad-method-colon=after
--pad-header
--pad-method-prefix
--pad-oper
-A8
--unpad-paren
View asd.yaml
swagger: 2.0
host: api.quantum.smeltzer.digital
schemes:
- http
- https
consumes:
- application/json
produces:
- application/json
info:
@Furkanzmc
Furkanzmc / zxcvbn-qt.patch
Created Aug 31, 2018
Patch for zxcvbn-c to make it work with Qt
View zxcvbn-qt.patch
diff --git a/zxcvbn.c b/zxcvbn.c
index ebe9e31..5b2dcf3 100644
--- a/zxcvbn.c
+++ b/zxcvbn.c
@@ -41,6 +41,7 @@
#include <stdio.h>
#else
#include <fstream>
+#include <QFile>
#endif
@Furkanzmc
Furkanzmc / comparisons.h
Created Sep 2, 2018
DRY Multicomparisons
View comparisons.h
template <typename Type, typename ComparisonFunc = std::equal_to<Type>>
class is
{
public:
constexpr is(Type t)
: m_Value(std::move(t))
{}
bool any_of(const std::initializer_list<Type> &list) const
{