Discover gists
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
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
connect25lovylmq.onion <-- blackbook a privacy based social network | |
sejnfjrq6szgca7v.onion <---- Tor mirror of Debian.org | |
pugljpwjhbiagkrn.onion <-- Debian manpages | |
7b42twezybs23hrr.onion <--- linux.sh terminal based file shareing utility | |
74ypjqjwf6oejmax.onion <-- Beneath VT, Exploring Virginia Tech's steam tunnels and beyond |
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
int rec=2; | |
int play=3; | |
int sensor=4; | |
int led=13; | |
void setup() | |
{ | |
pinMode(rec,OUTPUT); | |
pinMode(play,OUTPUT); | |
pinMode(led,OUTPUT); |
NewerOlder