mat3 yuv2rgb = mat3(1.0, 0.0, 1.28033, 1.0, -0.21482, -0.38059, 1.0, 2.12798, 0.0);
mat3 rgb2yuv = mat3(0.2126, 0.7152, 0.0722, -0.09991, -0.33609, 0.43600, 0.615, -0.5586, -0.05639);
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
tell application "Finder" | |
set pathList to (quoted form of POSIX path of (folder of the front window as alias)) | |
end tell | |
tell application "Terminal" | |
do shell script "cd " & pathList & "; ls | pbcopy" | |
end tell |
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
tell application "Finder" | |
set pathList to (quoted form of POSIX path of (folder of the front window as alias)) | |
end tell | |
tell application "System Events" | |
if not (exists (processes where name is "iTerm2")) then | |
do shell script "open -a iTerm " & pathList | |
else | |
tell application "iTerm" | |
set newWindow to (create window with default profile) |
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
javascript: !(function (window, document) { | |
var tempTextArea = document.createElement("textarea"); | |
const copyText = document.getSelection(); | |
(tempTextArea.textContent = window.location.href), | |
document.body.appendChild(tempTextArea), | |
copyText.removeAllRanges(), | |
tempTextArea.select(), | |
document.execCommand("copy"), | |
copyText.removeAllRanges(), |
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
const DefaultHeight = 768; | |
init() { | |
this.updateRootCSSScale(); | |
window.addEventListener('resize', e => { | |
this.updateRootCSSScale(); | |
}); | |
} |
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
&:after { | |
width: 100%; | |
color: magenta; | |
font-weight: bold; | |
content: attr(aria-label); | |
position: absolute; | |
left: 0; | |
top: 0; | |
} |
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
echo "Creating an SSH key for you..." | |
ssh-keygen -t rsa | |
echo "Please add this public key to Github \n" | |
echo "https://github.com/account/ssh \n" | |
read -p "Press [Enter] key after this..." | |
echo "Installing xcode-stuff" | |
xcode-select --install |
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
window.addEventListener('keyup', (event: KeyboardEvent) => { | |
if (event.key === "Tab") { | |
console.log('document.activeElement', document.activeElement); | |
} | |
}); |
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
float map(float value, float min1, float max1, float min2, float max2) { | |
return min2 + (value - min1) * (max2 - min2) / (max1 - min1); | |
} |
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
tell application "Finder" | |
if exists Finder window 1 then | |
set currentDir to target of Finder window 1 as alias | |
else | |
set currentDir to desktop as alias | |
end if | |
end tell |
NewerOlder