Skip to content

Instantly share code, notes, and snippets.

View MingruiZhangW's full-sized avatar
🍉

MingRui Zhang MingruiZhangW

🍉
View GitHub Profile
@aras-p
aras-p / preprocessor_fun.h
Last active November 15, 2024 09:22
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@hostilefork
hostilefork / listener.c
Last active November 6, 2024 11:10
Simple listener and sender for UDP multicast
//
// Simple listener.c program for UDP multicast
//
// Adapted from:
// http://ntrg.cs.tcd.ie/undergrad/4ba2/multicast/antony/example.html
//
// Changes:
// * Compiles for Windows as well as Linux
// * Takes the port and group on the command line
//
@atelierbram
atelierbram / convert-markdown-to-html-css-with-pandoc.md
Created April 2, 2017 10:46
Convert markdown files to html with Pandoc

Convert Markdown to html+css with Pandoc

Convert single markdown file to html from commandline:

  pandoc -f markdown -t html5 -o output.html input.md -c style.css

Convert multiple markdown files

@MingruiZhangW
MingruiZhangW / README.md
Created March 11, 2020 23:57
Functional-Level Linking /Gy

Functional-Level Linking /Gy

  • For visual c++, /Gy -> is to provide a way of compiling functions into individual sections in object file. when the linker needs some functions, the section will be merged into the final output. For the function that are not used, they will be abandoned.

This will greatly decrease the length of the final output, but it will also slow down the compiling and the linking process.
Since the linker will calculate the dependencies of functions, and to keep all functions into individual sections will also increase the time of doing relocations. In the mean time, object files will also be large.