Skip to content

Instantly share code, notes, and snippets.

View long-gong's full-sized avatar
๐Ÿ’ญ
I may be slow to respond.

Long Gong long-gong

๐Ÿ’ญ
I may be slow to respond.
View GitHub Profile
@long-gong
long-gong / demangle.md
Last active November 21, 2020 18:48
C++ human-readable type name

Sometimes, we want to print the name of the type of a variable for debugging purpose or some other reasons. Mordern C++ has provide us an API called typeid to get the std::type_info object representing the type, where type_info::name returns full type names. Unfortunately, such names are usually not human-readable. To make them human-readable, we need demangle them. Here is an example of using abi::__cxa_demangle to get human-readable type names. If folly is avaialble on your system, you can use folly::demangle to do this, which is a wrapper of abi::__cxa_demangle helping you deal with the memeory deallocation issue.

#include <iostream>
#include <cxxabi.h>

struct empty { };

template <typename T, int N>
  struct bar { };

MacBook Air SSD Upgrade Experience

Recently, I've upgraded the SSD of my MacBook Air.

My MacBook Air was bought in 2015, which has 4G RAM and 128G SSD. During my daily use of this MacBook Air, I found that 128G SSD is far from enough. I have to frequently regularly remove some files from it to make sure it does not run out of SSD space. Actually, I would be even better if its RAM can also be upgraded. However, after I open the MacBook Air, I found it is almost impossible for me to upgrade the RAm by myself (Though there are tutorials on YouTube).

@long-gong
long-gong / README.md
Created February 21, 2019 20:05 — forked from roachhd/README.md
EMOJI cheatsheet ๐Ÿ˜›๐Ÿ˜ณ๐Ÿ˜—๐Ÿ˜“๐Ÿ™‰๐Ÿ˜ธ๐Ÿ™ˆ๐Ÿ™Š๐Ÿ˜ฝ๐Ÿ’€๐Ÿ’ข๐Ÿ’ฅโœจ๐Ÿ’๐Ÿ‘ซ๐Ÿ‘„๐Ÿ‘ƒ๐Ÿ‘€๐Ÿ‘›๐Ÿ‘›๐Ÿ—ผ๐Ÿ”ฎ๐Ÿ”ฎ๐ŸŽ„๐ŸŽ…๐Ÿ‘ป

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. โœˆ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: ๐Ÿ˜„