Guides for setting up a Linux computer to play video games in emulators.
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
| transcodeHEVCAll() { | |
| for file in "$1"/**/*(.); do | |
| transcodeHEVC "$file" | |
| done | |
| } | |
| transcodeHEVC() { | |
| file="$1" | |
| ext="${file##*.}" | |
| base=$(basename $file $ext) |
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 { Suspense, use } from "react"; | |
| import { ErrorBoundary } from "react-error-boundary"; | |
| import type { Route } from "./+types.ts"; | |
| export async function loader() { | |
| // not awaited | |
| const reviews = getReviews(); | |
| // awaited (blocks the transition) | |
| const book = await fetch("/api/book").then(res => res.json()); |
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 { signal, computed } from '@angular/core' | |
| function writable<T>(fn: () => T) { | |
| const c = computed(() => signal(fn())) | |
| const w = () => c()() | |
| Object.assign(w, { set: value => c().set(value) }) | |
| return w | |
| } | |
| function derived<T>(value: T, fn: (previous: T) => T) { |
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
| public protocol Pointer<Pointee>: ~Copyable { | |
| associatedtype Pointee | |
| var pointee: Pointee { get nonmutating set } | |
| } | |
| public struct UniquePointer<Pointee>: ~Copyable, Pointer { | |
| private let memory: UnsafeMutablePointer<Pointee> | |
| public var pointee: Pointee { | |
| get { memory.pointee } |
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 { createMemo, createEffect } from 'solid-js'; | |
| export async function* createEffectStream<T>(fn: () => T) { | |
| let promises: Promise<T>[] = []; | |
| let resolve: (value: T) => void; | |
| promises.push( | |
| new Promise(r => { | |
| resolve = r; | |
| }), | |
| ); |
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 SwiftUI | |
| extension View { | |
| func wiggling() -> some View { | |
| modifier(WiggleModifier()) | |
| } | |
| } | |
| struct WiggleModifier: ViewModifier { | |
| @State private var isWiggling = false |
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
| extension Array { | |
| func combine(_ numberOfElements: Int) -> [[Element]] { | |
| guard numberOfElements > 0 else { return [.init()] } | |
| guard let first = first else { return [] } | |
| return Array(dropFirst()) | |
| .combine(numberOfElements - 1) | |
| .map { [first] + $0 } + | |
| Array(dropFirst()) | |
| .combine(numberOfElements) |
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 tweepy # pip3 install tweepy | |
| import json | |
| from datetime import datetime, timedelta, timezone | |
| CONSUMER_KEY = "**********" | |
| CONSUMER_SECRET = "**********" | |
| def oauthLogin(consumerKey, consumerSecret): | |
| auth = tweepy.OAuthHandler(consumerKey, consumerSecret) | |
| authURL = auth.get_authorization_url() |
Features I would like to see from Swift and its core ecosystem, to make it a robust and ergonomic language for all use cases.
- ❌ = Unimplemented / no accepted design
- 📜 = Manifesto / vision
- ⚾️ = Pitch / discussion
- 💍 = Proposal
- ⛔️ = Partially implemented / preview / gated / awaiting fuller implementation
⚠️ = In active review