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 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 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 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 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 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 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 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 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 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, |
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
;; User behaviors | |
;; ----------------------------- | |
;; Behaviors are stored as a set of diffs that are merged together | |
;; to create the final set of functionality that makes up Light Table. You can | |
;; modify these diffs to either add or subtract functionality. | |
;; | |
;; Behaviors are added to tags, objects with those tags then automatically gain | |
;; whatever logic the behavior imparts. To see a list of user-level behaviors, | |
;; start typing a word related to the functionality you want in between the square | |
;; brackets (e.g. "theme"). |
NewerOlder