Skip to content

Instantly share code, notes, and snippets.

@amdrade
amdrade / getMimeTypefromString
Created October 30, 2020 13:52
Get mimeType from file extension as string
//Mime types. Some keys are duplicated.
array(
".3dm"=>"x-world/x-3dmf",
".3dmf"=>"x-world/x-3dmf",
".a"=>"application/octet-stream",
".aab"=>"application/x-authorware-bin",
".aam"=>"application/x-authorware-map",
".aas"=>"application/x-authorware-seg",
".abc"=>"text/vnd.abc",
@amdrade
amdrade / git-apply-patch.md
Created November 6, 2018 17:08 — forked from emmanueltissera/git-apply-patch.md
Generate a git patch for a specific commit

Creating the patch

git format-patch -1 <sha>
OR
git format-patch -1 HEAD

Applying the patch

git apply --stat file.patch # show stats.
git apply --check file.patch # check for error before applying