Get Mountain Lion and Homebrew to Be Happy
1) Install XCode 4.4 into /Applications
Get it from the App Store.
2) Install Command Line Tools
In XCode's Preferences > Downloads you can install command line tools.
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- ready_for_review |
document.querySelectorAll('button[aria-label="Toggle diff contents"]').forEach(b => b.click()) |
defmodule Example.Application do | |
@moduledoc false | |
use Application | |
def start(_type, _args) do | |
children = [ | |
Example.Repo, | |
ExampleWeb.Telemetry, | |
{Phoenix.PubSub, name: Example.PubSub}, |
const bytes = await Deno.readFile(new URL('./thumbnail.png', import.meta.url)) | |
const encoder = new TextEncoder() | |
const contents = encoder.encode( | |
`export const thumbnail = new Blob(new Uint8Array(${ | |
JSON.stringify(Array.from(bytes)) | |
}), { type: 'image/png' })` | |
) | |
await Deno.writeFile(new URL('./hardcoded-thumbnail.ts', import.meta.url), contents) |
const status = 301 | |
addEventListener('fetch', event => { | |
const url = new URL(event.request.url) | |
url.hostname = url.hostname.replace(/^www\./, '') | |
event.respondWith(Response.redirect(url.toString(), status)) | |
}) |
import { assertEquals } from 'https://deno.land/std@0.125.0/testing/asserts.ts' | |
Deno.test('async iterator throw in next should throw in for scope', async () => { | |
const results: number[] = [] | |
const numbers = (() => { | |
let counter = 0 | |
const iterator: AsyncIterator<number> = { | |
// deno-lint-ignore require-await |
// NOTE: We must export or import at least one thing so we are not in | |
// the "global" scope, but in a module scope which is re-declarable. | |
// | |
// The error from tsserver is: 2451: Cannot redeclare block-scoped | |
// variable 'self'. | |
// | |
// Even tho this is not really a module and cannot be: ServiceWorkers | |
// cannot be modules. | |
export type Version = number |
Get it from the App Store.
In XCode's Preferences > Downloads you can install command line tools.
export class Deferred<T = void, E = Error> { | |
#promise: Promise<T> | |
// deno-lint-ignore ban-ts-comment | |
// @ts-ignore | |
resolve: (arg: T) => void | |
// deno-lint-ignore ban-ts-comment | |
// @ts-ignore | |
reject: (arg: E) => void | |
constructor() { |
console.log('Fetching...') | |
const res = await fetch('https://example.com') | |
const body = new Uint8Array(await res.arrayBuffer()) | |
console.log('---') | |
await Deno.stdout.write(body) | |
console.log('---') | |
console.log('Done.') |