Skip to content

Instantly share code, notes, and snippets.

@aras-p
aras-p / preprocessor_fun.h
Last active July 16, 2024 02:50
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,
@branneman
branneman / better-nodejs-require-paths.md
Last active June 29, 2024 16:00
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@saviour123
saviour123 / remover.sh
Last active April 17, 2024 15:49
Remove annoying Microsoft autoupdate agent from Mac / apple osx
# This bash script help to remove the microsoft autoupdate agent for poping up
# every now and then on your computer
# instruction
# open the Terminal app on you macbook
# copy and paste the below and voila.
# You are saved. It would ask you for password in executing sudo command
sudo rm -rf /Library/Application\ Support/Microsoft/MAU2.0
sudo rm -rf /Library/LaunchAgents/com.microsoft.update.agent.plist
sudo rm -rf /Library/LaunchDaemons/com.microsoft.autoupdate.helper.plist