Skip to content

Instantly share code, notes, and snippets.

@metabacalhau
metabacalhau / install_previous_version_homebrew_cask.md
Created June 4, 2024 08:50
Install a previous version of an application with Homebrew Cask

https://medium.com/@dallasclark/install-a-previous-version-of-an-application-with-homebrew-cask-9d3b8d288db6

  • Go to the Homebrew Cask GitHub Project Page.
  • Click “Find File” (Shortcut: T).
  • Type in the application name.
  • Click the *.rb file of the application you need.
  • Click “History.”
  • Find the version you need by reading the commit messages and viewing the raw file. Confirm the version variable (normally on line 2) is the version you need.
  • Copy the raw link to the file.
  • Install the specific version you need using brew cask install.
@metabacalhau
metabacalhau / macos_ssh.md
Last active November 10, 2023 14:32
[Permanently add SSH keys to Mac OS] #ssh #macos
@metabacalhau
metabacalhau / rfc822-regex.md
Last active December 19, 2022 08:14
RegExp that validates addresses according to the RFC 822 grammar
)+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:
\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(
?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ 
\t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\0
31]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\
](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+
(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:
(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z
|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)
@metabacalhau
metabacalhau / mac_os_bash_autocomplete.sh
Last active March 7, 2022 10:16
mac os bash autocomplete
# Type in terminal nano ~/.inputrc
set completion-ignore-case on
set show-all-if-ambiguous on
TAB: menu-complete
# CTRL + O, CTRL + X
# Reopen terminal
@metabacalhau
metabacalhau / Jest transformation issue on Windows (slashes in file paths)
Created October 25, 2021 15:24
Jest transformation issue on Windows (slashes in file paths)
// Problem with tests on Windows: Jest encountered an unexpected token... SyntaxError: Unexpected token...
// Reason: Node.js treats slashes differently on Unix => foo/bar and Windows => foo\\bar
// Solution: Use Regex for both systems [/\\\\]
module.exports = {
transform: {
'foo[/\\\\]bar[/\\\\].*\\.svg$': require.resolve('./mocks/svg.js'),
},
};
if (allTimeShekeli <= 500) {
slogan.innerHTML = "Ты уличный еврей.";
} else if (allTimeShekeli <= 1000) {
slogan.innerHTML = "Ты воруешь деньги у котов и собак.";
} else if (allTimeShekeli <= 5000) {
slogan.innerHTML = "Твои навыки поражают всю твою семью.";
} else if (allTimeShekeli <= 10000) {
slogan.innerHTML = "Ты воруешь деньги у местных политиков.";
} else if (allTimeShekeli <= 20000) {
slogan.innerHTML = "Ты начал курс 'Юного Еврея'";
@metabacalhau
metabacalhau / gist:6a08367475716131de3a2c4597958218
Last active June 21, 2021 10:53
Charles - Map Local - CORS error
MAC:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --disable-web-security
Windows:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security
@metabacalhau
metabacalhau / fakeDefaultExport.js
Created June 16, 2021 07:45
fakeDefaultExport
function fakeDefaultExport(moduleRelativePath, stubs) {
if (require.cache[require.resolve(moduleRelativePath)]) {
delete require.cache[require.resolve(moduleRelativePath)];
}
Object.keys(stubs).forEach(function (dependencyRelativePath) {
require.cache[require.resolve(dependencyRelativePath)] = {
exports: stubs[dependencyRelativePath]
};
});
@metabacalhau
metabacalhau / my-ublock-static-filters.txt
Last active February 21, 2022 15:32
uBlock - My filters
! Updated on: 21.02.2022
! 2020-11-23 https://meduza.io
meduza.io##.App-bannerTop
meduza.io##.DFPBanner-inorder.DFPBanner-root
! https://observador.pt
observador.pt##body.premium-article:not(.premium-user) .article-body p:not(:first-child):style(opacity: 1 !important; visibility: visible !important;)
observador.pt##body.premium-article:not(.premium-user) .article-body:not(:first-child):style(opacity: 1 !important; visibility: visible !important;)
observador.pt##body.premium-article:not(.premium-user) .article-block:style(opacity: 1 !important; visibility: visible !important;)