A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
// Copyright (c) 2017 Kristopher Johnson | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a | |
// copy of this software and associated documentation files (the | |
// "Software"), to deal in the Software without restriction, including | |
// without limitation the rights to use, copy, modify, merge, publish, | |
// distribute, sublicense, and/or sell copies of the Software, and to | |
// permit persons to whom the Software is furnished to do so, subject to | |
// the following conditions: | |
// |
/* | |
For this Gist, we have two sides: sender and receiver. The same user can be a sender and a receiver, but I will separate this | |
two roles to be more clear. | |
This gist assumes thatyou already have a MCSession created, and the peers are connected, | |
*/ | |
import Cocoa | |
import SceneKit | |
class ViewController: NSViewController { | |
@IBOutlet weak var sceneView: SCNView! | |
@IBOutlet weak var loadButton: NSButton! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
loadButton.target = self |
import { Texture, ImageLoader, DefaultLoadingManager, RGBAFormat, RGBFormat } from 'three'; | |
function TextureAtlasLoader(manager) { | |
this.manager = manager || DefaultLoadingManager; | |
} | |
Object.assign(TextureAtlasLoader.prototype, { | |
crossOrigin: "Anonymous", | |
tileWidth: 16, | |
tileHeight: 16, |
A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
func line(from p1: SCNVector3, to p2: SCNVector3) -> SCNNode? { | |
// Draw a line between two points and return it as a node | |
var indices = [Int32(0), Int32(1)] | |
let positions = [p1, p2] | |
let vertexSource = SCNGeometrySource(vertices: positions) | |
let indexData = Data(bytes: &indices, count:MemoryLayout<Int32>.size * indices.count) | |
let element = SCNGeometryElement(data: indexData, primitiveType: .line, primitiveCount: 1, bytesPerIndex: MemoryLayout<Int32>.size) | |
let line = SCNGeometry(sources: [vertexSource], elements: [element]) | |
let lineNode = SCNNode(geometry: line) |
I bought M1 MacBook Air. It is the fastest computer I have, and I have been a GNOME/GNU/Linux user for long time. It is obvious conclusion that I need practical Linux desktop environment on Apple Silicon.
Fortunately, Linux already works on Apple Silicon/M1. But how practical is it?
// | |
// Created by Szymon Błaszczyński on 26/08/2021. | |
// | |
import Foundation | |
import MetalKit | |
import SwiftUI | |
struct MetalView: NSViewRepresentable { | |
func makeCoordinator() -> Coordinator { |
import { | |
Texture, | |
ImageLoader, | |
RGBFormat, | |
CanvasTexture, | |
} from "../build/three.module.js"; | |
export const makeAtlas = (images, size, width, height) => { | |
return new Promise((resolve) => { | |
loadAllImages(images).then((data) => |
import SwiftUI | |
/// A view that arranges its children in horizontal lines | |
/// | |
/// FlowStack { | |
/// ForEach(1..<100) { num in | |
/// Text(String(num)) | |
/// .padding(8) | |
/// .background(Circle().fill(Color.red)) | |
/// } |