This is the source code of one of my blog post. To read the full blog post please click here.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**************************************************************************/ | |
/*! | |
@brief Custom lookup tables for full screen updates. Public domain (?) from Waveshare. | |
@note Video explainer: https://www.youtube.com/watch?v=MsbiO8EAsGw and more info: | |
https://benkrasnow.blogspot.com/2017/10/fast-partial-refresh-on-42-e-paper.html | |
@warning YOU CAN PERMANENELY DAMAGE YOUR DISPLAY BY ABUSING THESE LOOKUP TABLES! | |
Seriously, the controller is incredibly programmable and you can force all | |
kinds of voltages and timings onto the screen that it wasn't meant to deal | |
with. TWEAK AT YOUR OWN RISK! | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROJECT(project C) | |
CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0) | |
FIND_PACKAGE(PkgConfig REQUIRED) | |
PKG_CHECK_MODULES(GLIB REQUIRED glib-2.0) | |
INCLUDE_DIRECTORIES( | |
src/include/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set the control character to Ctrl+Spacebar (instead of Ctrl+B) | |
set -g prefix C-space | |
unbind-key C-b | |
bind-key C-space send-prefix | |
# Set new panes to open in current directory | |
bind c new-window -c "#{pane_current_path}" | |
bind '"' split-window -c "#{pane_current_path}" | |
bind % split-window -h -c "#{pane_current_path}" |
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple CMake utility to read variables from MK files | |
# - Gets contents from given file (name or path) | |
# - Parses the assignment statements | |
# - Makes the same assignments in the PARENT_SCOPE | |
if(POLICY CMP0007) | |
cmake_policy(SET CMP0007 NEW) | |
endif() | |
function(ReadVariables MKFile) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Lets say we want to add a library and an executable, both with the same name. | |
# In this example, it is resman | |
add_library(resman ${src_cpps} ${src_hpps} ) | |
target_link_libraries(resman ${Boost_LIBRARIES} ${LIBYAML} ${LIBFMT}) | |
# | |
# Add resman executable | |
# | |
# We call the executable resman-bin | |
add_executable(resman-bin main.cpp ) |
-
CTRL + A
— Move to the beginning of the line -
CTRL + E
— Move to the end of the line -
CTRL + [left arrow]
— Move one word backward (on some systems this is ALT + B) -
CTRL + [right arrow]
— Move one word forward (on some systems this is ALT + F) -
CTRL + U
— (bash) Clear the characters on the line before the current cursor position -
CTRL + U
—(zsh) If you're using the zsh, this will clear the entire line -
CTRL + K
— Clear the characters on the line after the current cursor position -
ESC + [backspace]
— Delete the word in front of the cursor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* OneTimePasswordAlgorithm.java | |
* OATH Initiative, | |
* HOTP one-time password algorithm | |
* | |
*/ | |
/* Copyright (C) 2004, OATH. All rights reserved. | |
* | |
* License to copy and use this software is granted provided that it |
NewerOlder