Skip to content

Instantly share code, notes, and snippets.

View avinal's full-sized avatar
🌠
2⁸²⁵⁸⁹⁹³³ - 1

Avinal Kumar avinal

🌠
2⁸²⁵⁸⁹⁹³³ - 1
View GitHub Profile
/**************************************************************************/
/*!
@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!
*/
@growlnx
growlnx / CMakeLists.txt
Last active May 12, 2024 23:37
GLIB with cmake
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/
@william8th
william8th / .tmux.conf
Last active July 4, 2024 11:36
Tmux open new pane in same directory
# 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}"
@unnikked
unnikked / README.md
Last active February 19, 2024 02:58
How to host your Telegram bot on Google App Script

Telegram Bot on Google App Script

This is the source code of one of my blog post. To read the full blog post please click here.

@mbinna
mbinna / effective_modern_cmake.md
Last active July 16, 2024 05:57
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

@tusharpm
tusharpm / ReadVariables.cmake
Created May 28, 2017 09:58
Reading external Makefile variables (only) into CMake
# 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)
@jlgerber
jlgerber / CMakeLists.txt
Last active May 21, 2024 20:28
cmake - handling executable and library with same name
# 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 )
@acamino
acamino / README.md
Last active July 15, 2024 19:54
Shortcuts to Improve Your Bash & Zsh Productivity

Shortcut — Action

  • 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
@bvermeule
bvermeule / OneTimePasswordAlgorithm.java
Created August 2, 2016 09:23
HOTP Algorithm: Reference Implementation
/*
* 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