This file contains hidden or 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
| // First do this: https://webgl2fundamentals.org/webgl/lessons/webgl-picking.html | |
| // then modify it with something like the below | |
| const pickedData = new Uint8Array(4); | |
| const pickingBuffer = gl.createBuffer(); | |
| const afterReadPixels = () => gl.bindFramebuffer(gl.FRAMEBUFFER, null); | |
| let picking = false; | |
| const pick = async () => { | |
| if (picking) return pickedData; |
This file contains hidden or 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 observer = new ResizeObserver((entries) => { | |
| const entry = entries[0]; | |
| if (entry.devicePixelContentBoxSize) { | |
| canvas.width = entry.devicePixelContentBoxSize[0].inlineSize; | |
| canvas.height = entry.devicePixelContentBoxSize[0].blockSize; | |
| } else if (entry.contentBoxSize) { | |
| // Annoying fallback. Assumes window.devicePixelRatio includes browser zoom. | |
| // Currently that's how it works in Chrome, but not in Safari. | |
| // As a result current Safari will end up with the wrong size if browser zoom is in use. |
This file contains hidden or 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
| import React, { | |
| useContext, | |
| useEffect, | |
| useRef, | |
| createContext, | |
| useState, | |
| useCallback, | |
| } from "react"; | |
| import createCamera from "perspective-camera"; |
This file contains hidden or 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
| // https://github.com/calebdwilliams/construct-style-sheets | |
| import "construct-style-sheets-polyfill"; | |
| export default strings => { | |
| if (document.readyState === "loading") { | |
| window.addEventListener("DOMContentLoaded", () => adopt(strings)); | |
| } else { | |
| adopt(strings); | |
| } | |
| }; |
This file contains hidden or 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 cubeCoordinatesToRegionCenter = (x, y, z, r) => { | |
| const centerX = x * 2 * r + x + r * z; | |
| const centerZ = z * -2 * r - z - x + -r * x; | |
| return [centerX, -centerX-centerZ, centerZ]; | |
| }; |
This file contains hidden or 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
| xcode-select --install | |
| gem install nokogiri -v '1.7.0.1' -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/libxml2 --use-system-libraries |
This file contains hidden or 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
| gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config | |
| If you run in to missing headers problem, try specifying the include directory of the app: | |
| gem install pg -- --with-pg-include='/Applications/Postgres.app/Contents/Versions/9.4/include/' |
This file contains hidden or 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
| The definition of a rathole: | |
| My TV torrents stopped downloading. | |
| Turns out my primary TV torrent feed changed to magnet links. | |
| Turns out my autodownloader doesn't know how to pass magnet links to my torrent client. | |
| Changed to another client. | |
| *mysterious errors* | |
| Turns out the client has to be installed in Program Files instead of Program Files (x86). | |
| Uninstalling it and reinstalling it there. | |
| *other mysterious errors* | |
| Turns out the client has to be installed with the same version of Python as the autodownloader. |
This file contains hidden or 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
| /* | |
| I should probably have turned this into a theme…, | |
| but who has time for that? | |
| Installation: | |
| 1. Choose "Atom Dark" as your UI theme. | |
| 2. Choose "Solarized Dark" as your syntax theme. | |
| 3. Install Input from http://input.fontbureau.com/ | |
| (It's free for personal use.) |
This file contains hidden or 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
| input[type="text"], | |
| input[type="email"], | |
| input[type="password"], | |
| textarea, | |
| .fieldset-footer, | |
| .hint, | |
| input[type="submit"], | |
| button, | |
| .button, | |
| .error, |
NewerOlder