Skip to content

Instantly share code, notes, and snippets.

View asit-dhal's full-sized avatar

Asit Kumar Dhal asit-dhal

View GitHub Profile
@deckarep
deckarep / goroutine-channel-pattern.go
Last active December 13, 2016 20:46
A Goroutine safe pattern using channels that abstracts away the usage of channels.
/*
A Goroutine safe pattern using channels that abstracts away the channels
This is a concept of creating a goroutine safe object that uses channels under the covers to communicate
with the internal map[string]string structure. I know that typically this kind of solution may done
with mutexes but the excercise was in using channels on purpose although they are heavier.
Note a couple of points:
- When using channels, you can still build a public-facing api that nicely abstracts them away, therefore
@soarez
soarez / ca.md
Last active June 19, 2024 19:32
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@larrybotha
larrybotha / A.markdown
Last active June 12, 2024 23:25
Merge wiki updates that are on a fork of your repo.

Merge Wiki Changes From A Forked Github Repo

This is inspired (or basically copied) from How To Merge Github Wiki Changes From One Repository To Another, by Roman Ivanov, and serves to ensure that should something happen to the original article, the information remains nice and safe here.

Terminology

OREPO: original repo - the repo created or maintained by the owner

FREPO: the forked repo that presumably has updates to its wiki, not yet on the OREPO

@randomphrase
randomphrase / cmdoptions.cpp
Last active May 25, 2024 08:26
Demonstration of how to do subcommand option processing with boost program_options
#define BOOST_TEST_MODULE subcommand options
#include <boost/test/unit_test.hpp>
#include <boost/program_options.hpp>
#include <boost/variant/variant.hpp>
#include <boost/variant/get.hpp>
struct GenericOptions {
bool debug_;
};
@dlrdave
dlrdave / varprops.cmake
Last active April 15, 2022 15:27
Demonstrate get_property usage for VARIABLE and CACHE properties
# This section of the documentation lists the properties available on
# CMake cache entries:
#
# http://cmake.org/cmake/help/v2.8.12/cmake.html#section_PropertiesonCacheEntries
#
#
# This code demonstrates retrieving the property values from a variable or
# cache entry.
#
@mbbx6spp
mbbx6spp / README.md
Last active May 28, 2024 13:52
Gerrit vs Github for code review and codebase management

Gerrit vs Github: for code review and codebase management

Sure, Github wins on the UI. Hands down. But, despite my initial annoyance with Gerrit when I first started using it almost a year ago, I am now a convert. Fully. Let me tell you why.

Note: This is an opinionated (on purpose) piece. I assume your preferences are like mine on certain ideas, such as:

  • Fast-forward submits to the target branch are better than allowing merge commits to the target branch. The reason I personally prefer this is that, even if a non-conflicting merge to the target branch is possible, the fact that the review/pull request is not up to date with the latest on the target branch means feature branch test suite runs in the CI pipeline reporting on the review/PR may not be accurate. Another minor point is that forced merge commits are annoying as fuck (opinion) and clutter up Git log histories unnecessarily and I prefer clean histories.
  • Atomic/related changes all in one commit is something worth striving for. Having your dev
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active July 2, 2024 17:58
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@vicrucann
vicrucann / polygon-fog-shader.cpp
Last active August 3, 2022 08:28
Basic example of a GLSL shader (vertex and fragment shaders) that simulates fog effect; using OpenSceneGraph for visualization
#ifdef _WIN32
#include <Windows.h>
#endif // _WIN32
#include <osg/Camera>
#include <osg/Drawable>
#include <osg/Geode>
#include <osg/Geometry>
#include <osg/Group>
#include <osg/Node>