Skip to content

Instantly share code, notes, and snippets.

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

Sonkeng sdmg15

👨‍💻
C++ ❤️
View GitHub Profile
@sdmg15
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?' — https://ivan.bessarabov.com/blog/famous-programmers-work-time
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
sdmg15 / effective_modern_cmake.md
Created May 13, 2019 20:01 — forked from mbinna/effective_modern_cmake.md
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](https://www.amazon.de/Large-Scale-Soft

@sdmg15
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'
@sdmg15
sdmg15 / tinyblockchain-cli.php
Created December 29, 2017 04:46 — forked from vgrovestine/tinyblockchain-cli.php
Dirt simple blockchain implemented in PHP
<?php
class Block {
private $ts;
private $nonce = 0;
private $data;
private $prev_hash;
protected $hash;
private $hash_algorithm;
private $hash_prefix;
@sdmg15
sdmg15 / bash-cheatsheet.sh
Created July 29, 2017 08:03 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04