Skip to content

Instantly share code, notes, and snippets.

View mister-good-deal's full-sized avatar

Romain Laneuville mister-good-deal

View GitHub Profile
@meetrajesh
meetrajesh / binary_search_tree.php
Last active January 18, 2022 16:53
An efficient binary search tree (BST) implementation in PHP.
<?php
class BinarySearchTree {
private $_root;
public function __construct() {
// setup sentinal node
$this->_root = new BinarySearchNode(null);
}
public function getRoot() {
return $this->hasNode() ? $this->_root->right : null;
@jhoff
jhoff / Enums.php
Last active November 18, 2023 20:47
Laravel Model Enumeration Trait
<?php
namespace App\Traits;
use Illuminate\Support\Str;
use App\Exceptions\InvalidEnumException;
trait Enums
{
/**
@jlblancoc
jlblancoc / Install_gcc7_ubuntu_16.04.md
Last active July 8, 2024 06:37
Installing gcc-7 & g++-7 in Ubuntu 16.04LTS Xenial

Run the following in the terminal:

Install the gcc-7 packages:

sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install g++-7 -y

Set it up so the symbolic links gcc, g++ point to the newer version:

@SuperKogito
SuperKogito / CaptureSceenshotUsingOpenCV.cpp
Last active November 10, 2023 09:08
Code for my blog post <https://superkogito.github.io/blog/CaptureScreenUsingOpenCv.html> A snippet for capturing the screen content using OpenCV
/*****************************************************************************************************************
* \file CaptureSceenshotUsingOpenCV.cpp
* \brief capture screenshot using OpenCV and save it as a png.
*
* \author SuperKogito
* \date July 2020
*
* @note:
* references and sources:
* - http://msdn.microsoft.com/en-us/library/windows/window/dd183402%28v=vs.85%29.aspx