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
| App.Utils.Array = (function () { | |
| 'use strict'; | |
| var utils = { | |
| // TESTED | |
| // check to see if a value is one of any of the supplied values | |
| anyValue: function (value, values) { | |
| return this.any(values, function (item) { | |
| return item === value; | |
| }); |
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
| window.toSmallCaps = (function () { | |
| var letters = "abcdefghijklmnopqrstuvwxyz"; | |
| var caps = "ᴀʙᴄᴅᴇғɢʜɪᴊᴋʟᴍɴᴏᴘǫʀsᴛᴜᴠᴡxʏᴢ"; | |
| return function replace(value) { | |
| var newValue = ''; | |
| for (i = 0; i < value.length; i++) { | |
| var letter = value[i]; | |
| var index = letters.indexOf(letter); |
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
| String.prototype.toSmallCaps = (function () { | |
| var letters = "abcdefghijklmnopqrstuvwxyz"; | |
| var caps = "ᴀʙᴄᴅᴇғɢʜɪᴊᴋʟᴍɴᴏᴘǫʀsᴛᴜᴠᴡxʏᴢ"; | |
| function translate(character) { | |
| var index = letters.indexOf(character); | |
| return index !== -1 ? caps.charAt(index) : character; | |
| } | |
| function mapReduce(value, transform) { |
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
| By | |
| Sarah Ellison and | |
| Elahe Izadi | |
| July 23, 2020 at 9:20 a.m. EDT | |
| This is what was on Thomas Chatterton Wiliams’s mind when he decided to write a short letter on the risks to liberalism and open discourse and get some like-minded thinkers to sign on. | |
| He was thinking of the Poetry Foundation, whose leaders resigned after their four-sentence statement in support of Black Lives Matter was deemed too tepid by 1,800-plus petition-signers. And the National Book Critics Circle, whose board imploded over its own attempt at such a statement. | |
| He was thinking of David Shor, a political scientist who was fired after tweeting about a study suggesting that violent street protests helped tip the 1968 election to the GOP; and Colin Kaepernick, a quarterback who was shunned from the NFL after his anti-racism activism ran afoul of conservative fans. |
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
| function element<e extends HTMLElementTagNameMap[keyof HTMLElementTagNameMap]>( | |
| tag: keyof HTMLElementTagNameMap, | |
| attributes: { [k in keyof HTMLParagraphElement]?: string; }, | |
| events: { [k in keyof HTMLElementEventMap]?: string; }, | |
| ...children: HTMLElement[] | |
| ): e { | |
| const element = document.createElement(tag) as e; | |
| Object.keys(attributes).forEach(key => { | |
| if (key === 'innerText') { |
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
| union(){ | |
| translate([0, 0, 2]) | |
| union() { | |
| translate([2,0,0]) cube([220,20,2]); | |
| translate([222,0,0]) cube([2,20,18]); | |
| cube([2,20,18]); | |
| translate([0,0,16]) | |
| linear_extrude( | |
| height = 2, |
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 root = 'https://api.spacetraders.io'; | |
| // utils | |
| const timeout = (seconds) => new Promise(resolve => setTimeout(resolve, seconds * 1000)); | |
| const sleeper = (seconds) => (x) => new Promise(resolve => setTimeout(() => resolve(x), seconds * 1000)); | |
| const userName = () => `user-${new Date().getTime()}-${Math.random()}`; | |
| const querySeparator = (path) => path.indexOf('?') === -1 ? '?' : '&'; | |
| const get = (path) => fetch(`${root}${path}`).then(x => x.json()).then(saveState).then(saveArchive).then(sleeper(1)); | |
| const post = (path, body) => fetch(`${root}${path}`, postOptions(body)).then(x => x.json()).then(saveState).then(saveArchive).then(sleeper(1)); | |
| const put = (path, body) => fetch(`${root}${path}`, putOptions(body)).then(x => x.json()).then(saveState).then(saveArchive).then(sleeper(1)); |
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
| $fa = 1; | |
| $fs = 1; | |
| bell_height = 50; | |
| bell_diameter = 10; | |
| bell_wall = 1.2; | |
| bell_foot_height = 10; | |
| bell_foot_gap = 5; | |
| snorkel_height = bell_height - 20; |
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
| $originalsFolder = 'originals' | |
| $resizedFolder = 'resized' | |
| $reorganizedFolder = 'reorganized' | |
| $originals = Get-ChildItem -Path $originalsFolder -Recurse -Include *.jpg | |
| foreach ($original in $originals) { | |
| $resized = Get-ChildItem -Path $resizedFolder -Recurse -Include $original.Name | |
| $destination = ($resized.FullName).Replace($resizedFolder, $reorganizedFolder).Replace($resized.Name, "") | |
| New-Item $destination -Type Directory |
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
| tube_radius = 4; | |
| wall = 1.2; | |
| ring_degree = 310; | |
| ring_radius = 80; | |
| ring_step = 10; | |
| hole_min_radius = 0.6; | |
| hole_max_radius = 1; | |
| hole_diff_radius = hole_max_radius - hole_min_radius; |