Tildes mean to ignore certain return arguments:
[folder, ~, ~] = fileparts(mfilename('fullpath'))
which doesn't return anything for the base filename, or the extension. Introduced somewhat recently.
Percent symbol means the rest of the line after the percent symbol is to be considered as a comment. Can be at the start of a line of text, on the line after the code statement is done.