Skip to content

Instantly share code, notes, and snippets.

View gil0mendes's full-sized avatar

Gil Mendes gil0mendes

View GitHub Profile
@gil0mendes
gil0mendes / remove-nix-darwin.sh
Last active February 11, 2024 22:46
Remove Nix from Darwin
nix-env --uninstall '*'
nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A uninstaller
./result/bin/darwin-uninstaller
sudo launchctl unload /Library/LaunchDaemon/org.nixos.nix-daemon.plist
sudo rm /Library/LaunchDaemons/org.nixos.nix-daemon.plist
sudo launchctl unload /Library/LaunchDaemons/org.nixos.activate-system.plist
sudo rm /Library/LaunchDaemons/org.nixos.activate-system.plist
sudo rm -rf /etc/nix /var/root/.nix-profile /var/root/.nix-defexpr /var/root/.nix-channels ~/.nix-profile ~/.nix-defexpr ~/.nix-channels
@gil0mendes
gil0mendes / index.js
Created September 8, 2021 16:42
Matrix 4 video URL generator
/**
* Matrix 4 video URL generator
* by: gil0mendes <gil00mendes@gmail.com>
*
* [ALERT]
* Please keep in mind that this code can stop working due to website changes. I really don't know if they will keep
* the files after announcing the trailer or film release.
*
* [CONTEXT]
* Matrix 4 teaser was announced with a interactive website that allows you to chose between the red and blue pill. It
@gil0mendes
gil0mendes / find-body-overflows.js
Created September 4, 2017 08:45
Find Unintended Body Overflows
(function () {
const docWidth = document.documentElement.offsetWidth;
[].forEach.call(
document.querySelectorAll('*'),
function(el) {
if (el.offsetWidth > docWidth) {
el.style.outline = '1px solid red';
console.log(el);
}
@gil0mendes
gil0mendes / ngControllerFromUrl.js
Last active August 29, 2015 14:11
ngControllerFromUrl
/**
* Load Controller from Url
* v: 1.0.2
*
* Created by Gil Mendes <gil00mendes@gmail.com>
*
* Usage:
* ng-controller-from-Url="<url_to_js>[|<controller_name>]"
*/
define([
@gil0mendes
gil0mendes / aliases
Last active August 29, 2015 14:03
Alias to control server services
### SERVER SERVICES ALIAS
# Nginx
alias nginx.start='sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist'
alias nginx.stop='sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.nginx.plist'
alias nginx.restart='nginx.stop && nginx.start'
# PHP-FPM
alias php-fpm.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php55.plist"
alias php-fpm.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php55.plist"
alias php-fpm.restart='php-fpm.stop && php-fpm.start'