Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Create directory for keyrings if it does not exist | |
sudo install -d -m 0755 /etc/apt/keyrings | |
# Download and save keyring | |
wget -q "https://packages.mozilla.org/apt/repo-signing-key.gpg" -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null | |
# The fingerprint should be 35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3 | |
gpg -n -q --import --import-options import-show /etc/apt/keyrings/packages.mozilla.org.asc | awk '/pub/{getline; gsub(/^ +| +$/,""); print "\n"$0"\n"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# ============================================================================= | |
# description: Ubuntu 22.04 Desktop Setup Script | |
# author: Victor Miti <https://github.com/engineervix> | |
# note: In its current state, this won't run unattended without issues. | |
# There are some manual interventions in between certain steps. | |
# The script primarily serves as documentation of the setup process | |
# for future reference. | |
# TODO: make this run unattended. |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
:: default : yabai -m config active_window_opacity 1; yabai -m config normal_window_opacity 1; | |
# Focus | |
shift + alt - home : yabai -m window --focus north | |
shift + alt - j : yabai -m window --focus north | |
shift + alt - end : yabai -m window --focus south | |
shift + alt - k : yabai -m window --focus south | |
shift + alt - delete : yabai -m window --focus west |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
sudo rm -f /usr/bin/node | |
sudo rm -f /usr/bin/npm | |
sudo ln -s $(which node) /usr/bin/ | |
sudo ln -s $(which npm) /usr/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public static class ScrollViewFocusFunctions | |
{ | |
public static Vector2 CalculateFocusedScrollPosition( this ScrollRect scrollView, Vector2 focusPoint ) | |
{ | |
Vector2 contentSize = scrollView.content.rect.size; | |
Vector2 viewportSize = ( (RectTransform) scrollView.content.parent ).rect.size; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//https://stackoverflow.com/a/6837426/1911609 | |
function strtolatin($string){ | |
if (strpos($string = htmlentities($string, ENT_QUOTES, 'UTF-8'), '&') !== false){ | |
$string = html_entity_decode(preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|tilde|uml);~i', '$1', $string), ENT_QUOTES, 'UTF-8'); | |
} | |
return $string; | |
} |
See how a minor change to your commit message style can make a difference.
Tip
Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs
NewerOlder