Skip to content

Instantly share code, notes, and snippets.

View johntranz's full-sized avatar
🏃‍♂️
No bugs no gain

John Tran johntranz

🏃‍♂️
No bugs no gain
  • Stdio Asia
  • Hue, Viet Nam, Earth
  • 02:17 (UTC +07:00)
  • LinkedIn in/johntranz
View GitHub Profile
@ndrplz
ndrplz / opencv_skin_segmentation.cpp
Created November 1, 2017 08:45
Simple hand segmentation from the webcam streaming.
#include <opencv2\opencv.hpp>
using namespace cv;
using std::cout;
/*--------------- SKIN SEGMENTATION ---------------*/
int main () {
VideoCapture cap(0);
if(!cap.isOpened())
@SKempin
SKempin / Git Subtree basics.md
Last active June 27, 2024 07:56
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

@kottenator
kottenator / simple-pagination.js
Created July 13, 2015 20:44
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@erkez
erkez / docker-deployment.sh
Last active May 31, 2023 08:20
Zero downtime deployment with docker application + nginx
#!/bin/bash
# Zero downtime deployment with docker application + nginx
# Maintainer: heitkotter [at] gmail.com
# Requirements
## Image on production server
## Nginx cannot be a container. This guarantees that containers will be served after reboot
# Script steps