This script lets you resize the active Terminal.app window from the CLI. If no values are specified it'll use the current profile's default size.
Set width and height:
$ resize 120 24
function youtubeSort () { | |
const channel = document.querySelector('#channel-title').textContent | |
const videos = [...document.querySelectorAll('#items > ytd-grid-video-renderer')] | |
.map(item => { | |
const metadataLine = item.querySelector('#details #meta #metadata-line') | |
const metadataViews = metadataLine.querySelector(':nth-child(1)').textContent | |
const metadataDate = metadataLine.querySelector(':nth-child(2)').textContent | |
const videoTitle = item.querySelector('#details #meta #video-title') |
// An example of a use-case for negative zero | |
const rtf = new Intl.RelativeTimeFormat('en') | |
rtf.format(0, 'hours') // 'in 0 hours' | |
rtf.format(-0, 'hours') // '0 hours ago' |
function getSelection () { | |
return Application('Finder') | |
.selection() | |
.map(item => urlToPath(item.url())) | |
.join('\n') | |
} | |
function getPath () { | |
const windows = Application('Finder').windows() | |
if (!windows.length) { |
div, span { | |
box-sizing: border-box; | |
position: relative; | |
display: flex; | |
flex-direction: column; | |
align-items: stretch; | |
flex-shrink: 0; | |
align-content: flex-start; |
const safari = Application('Safari') | |
const tabs = safari.windows[0].tabs | |
const list = [] | |
for (let i = 0; i < tabs.length; i++) { | |
const url = tabs[i].url() | |
if (url) { | |
list.push(url) | |
} | |
} |
test('the data is peanut butter', async () => { | |
expect(await fetchData()).toBe('peanut butter') | |
}) |
/* CommonJS */ | |
// a.js | |
let a = 1 | |
module.exports = { a } | |
setTimeout(() => { | |
a++ | |
}, 100) | |
// index.js |
I hereby claim:
To claim this, I am signing this object:
import { | |
cond, | |
conformsTo, | |
constant, | |
eq, | |
flow, | |
get, | |
matches, | |
replace, | |
startsWith, |