Skip to content

Instantly share code, notes, and snippets.

View sdmg15's full-sized avatar
C++ ❤️

Sonkeng sdmg15

C++ ❤️
View GitHub Profile
sdmg15 / tinyblockchain-cli.php
Created December 29, 2017 04:46 — forked from vgrovestine/tinyblockchain-cli.php
Dirt simple blockchain implemented in PHP
class Block {
private $ts;
private $nonce = 0;
private $data;
private $prev_hash;
protected $hash;
private $hash_algorithm;
private $hash_prefix;
// A helper function to determine the data model of the current platform
[[nodiscard]] constexpr const char* dataModelPlatform() {
if constexpr (sizeof(int) == 2 && sizeof(long int) == 8) {
if (sizeof(int*) == 2) {
return "ILP32";
return "LLP64";
#include <iostream>
#include <utility>
#include <tuple>
template<typename T>
void printWithSpace(T v) {
std::cout << v << " ";
syntax = "proto3";
package FIX;
import "executionreport.proto";
message NewOrderSingle {
string ClOrdID = 1;
string Instrument = 2;

Keybase proof

I hereby claim:

  • I am sdmg15 on github.
  • I am sdmg15 ( on keybase.
  • I have a public key ASDReENYgSw8E69a3p0qpf5v0cVPm2RgcwULuZiCw58bMgo

To claim this, I am signing this object:

sdmg15 / gist:fa6f6b3f69117e363bc7a15f8b88cc4a
Created July 19, 2019 17:21 — forked from bessarabov/gist:674ea13c77fc8128f24b5e3f53b7f094
One-liner to generate data shown in post 'At what time of day does famous programmers work?' —
git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }'
sdmg15 /
Created May 23, 2019 17:42
Libraries and resources made by Cameroonians

A list of libraries and resources made by Cameroonians

CLI utils

sdmg15 /
Created May 13, 2019 20:01 — forked from mbinna/
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](

Code of Conduct

All participants of DevOfFuture are expected to abide by our Code of Conduct, both online and during in-person events that are hosted and/or associated with DevOfFuture. The Pledge

In the interest of fostering an open and welcoming environment, we pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. The Standards

Examples of behaviour that contributes to creating a positive environment include:

sdmg15 / attributes.rb
Created April 22, 2019 09:34 — forked from lizthegrey/attributes.rb
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'