Skip to content

Instantly share code, notes, and snippets.

@DucNgn
DucNgn / PowerlineForTerminal.md
Last active March 29, 2024 03:28
Powerline style for terminal OSX

Installing and configuring Powerline-style command line tools for developers (OSX)

Intro:

For every developer, terminal is their weapon, so why don't you customize it to become a powerful, and a beautiful weapon?

Powerline style refers to a terminal style that helps developer to keep track of their workflow easily, allows them to have perfect visual on current directories and new changes. It is also git recognizable, and failure detector that will help your development process becomes more interact and much faster.

In this guideline, I will introduce you with 2 smart shells: Zsh and Fishshell. Both are perfect for the development jobs due to its rich of resources, and user-friendly.

Note:

@CMCDragonkai
CMCDragonkai / memory_layout.md
Last active July 24, 2024 16:48
Linux: Understanding the Memory Layout of Linux Executables

Understanding the Memory Layout of Linux Executables

Required tools for playing around with memory:

  • hexdump
  • objdump
  • readelf
  • xxd
  • gcore
@khvorov
khvorov / lambda_to_function.cpp
Last active March 21, 2024 06:19
Convert lambda to std::function
// g++ prog.cc -Wall -Wextra -O2 -march=native -std=gnu++1y
#include <cxxabi.h>
#include <algorithm>
#include <functional>
#include <iostream>
#include <typeinfo>
namespace detail
@mattes
mattes / check.go
Last active June 12, 2024 19:31
Check if file or directory exists in Golang
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) {
// path/to/whatever does not exist
}
if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) {
// path/to/whatever exists
}
@simonlynen
simonlynen / detect_arm_cmake
Created May 8, 2013 12:27
detect arm cmake
IF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
add_definitions (-mfloat-abi=softfp -mfpu=neon)
ELSE(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
ENDIF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")