Skip to content

Instantly share code, notes, and snippets.

View cgfarmer4's full-sized avatar
💭
🔥

Chase Farmer cgfarmer4

💭
🔥
View GitHub Profile
app.locals.use(function(req, res, done) {
res.locals.request = req;
done();
});
@cgfarmer4
cgfarmer4 / app.js
Last active August 29, 2015 13:57
Access top frame/window from iframe in node-webkit
// Update package.json with the following
"node-remote": "http://example.com",
"chromium-args": "--disable-web-security"
// HTML: <iframe src="http://example.com" nwfaketop></iframe>
parent.window.root.GLOBAL.window
@cgfarmer4
cgfarmer4 / AudioSessionManager.swift
Last active September 16, 2024 05:38
Poor mans streaming using AVCaptureSession
class AudioSessionManager: NSObject, ObservableObject {
@Published var microphones: [AVCaptureDevice] = []
var captureSession: AVCaptureSession = .init()
var audioOutput: AVCaptureAudioDataOutput?
var configured: Bool = false
private var audioInput: AVCaptureDeviceInput?
let dataOutputQueue = DispatchQueue(label: "audio_queue",
qos: .userInteractive,