Feel free to leave a comment or contribute if you think there's a way to improve this gist !
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
<?php | |
define('E_FATAL', E_ERROR | E_USER_ERROR | E_PARSE | E_CORE_ERROR | | |
E_COMPILE_ERROR | E_RECOVERABLE_ERROR); | |
define('ENV', 'dev'); | |
//Custom error handling vars | |
define('DISPLAY_ERRORS', TRUE); | |
define('ERROR_REPORTING', E_ALL | E_STRICT); |
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
#!/bin/bash | |
VIDEOS=$(ls *.mp4) | |
for VIDEO in $VIDEOS | |
do | |
ffmpeg -i $VIDEO -vcodec libx265 -crf 28 -f mp4 ${VIDEO%%.*}_compressed.mp4 | |
done |
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
#!/bin/bash | |
git status -s | |
read -p "Press any key to show diff" -n1 -s; echo | |
git --no-pager diff | |
read -p "Press any key to stage all files" -n1 -s; echo | |
git add . | |
git status -s |
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
// This is a C# example from Red Blob Games (https://www.redblobgames.com/pathfinding/a-star/implementation.html#csharp). Remade to have no GCAllocs | |
// Changes: | |
// - Made to work in Unity and draw gizmos on screen instead of console text; | |
// - Cache all collections in Init(), then when Search() is called, no allocs are being made; | |
// - Uses Unity's Vector2Int that avoids boxing when comparing structs; | |
// - graph.Neighbors() no longer uses an IEnumerable<>. instead, fill a list with neighbors; | |
using System; | |
using System.Collections.Generic; | |
using UnityEngine; |
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.
- There are always 24 hours in a day.
- February is always 28 days long.
- Any 24-hour period will always begin and end in the same day (or week, or month).
- 本文的有一些哲学是摘自互联网中他人所撰写的,还有一些是与同行探讨获得的建议,其中一部分建议来自 bolasblack
- 本文主要针对多人协作开发的大型项目的场景,并且是基于 Magickbase 的一些项目进行的思考
- 本文默认读者是具备一定英文读写能力和开发能力的开发者
- 不要只是去背下这些规则,而是要尝试理解它们的意图(解决什么问题)和手段(怎么解决)
- 思想很重要,思想会指导你如何开发、遇到问题时做出怎样的选择(做决策)
NewerOlder