Skip to content

Instantly share code, notes, and snippets.

:shipit:
codez

Blixt blixt

:shipit:
codez
Block or report user

Report or block blixt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@blixt
blixt / OculusQuest.md
Last active Jun 6, 2019
Streaming Oculus Quest wirelessly over WiFi to macOS (on a MacBook)
View OculusQuest.md

Streaming an Android-based VR headset to your computer

Setting it up the first time

The first time you have to set it up with a cable. The Oculus Quest has a USB-C port (the one used for charging). Use this to connect to your computer.

Preparing your Oculus Quest

Your Quest needs to be in Developer mode. This is super easy, just open your companion app on your phone and go to Settings and enable Developer

@blixt
blixt / middleware.go
Created May 5, 2017
A couple of middleware http.Handler functions for Go
View middleware.go
// A couple of middleware http.Handler functions (scroll down).
// EXAMPLE USAGE:
http.HandleFunc("/", RequestHome)
http.Handle("/s/", Cacher(168*time.Hour, http.StripPrefix("/s/", http.FileServer(http.Dir("static")))))
http.Handle("/favicon.ico", FileWithCache("static/favicon.ico", 168*time.Hour))
if err := http.ListenAndServe(":8080", Logger(http.DefaultServeMux)); err != nil {
log.Fatalf("http.ListenAndServe: %v", err)
@blixt
blixt / logger_middleware.go
Last active Sep 14, 2019
Logger middleware for Go HTTP servers which logs every request with response status code in the Apache format.
View logger_middleware.go
package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
"time"
)
View fragment.m
#import "AppDelegate.h"
#import <AVFoundation/AVFoundation.h>
@interface AppDelegate ()
@property (nonatomic) AVAssetWriter *writer;
@property (nonatomic) AVAssetWriterInputPixelBufferAdaptor *adaptor;
@property (nonatomic) dispatch_queue_t q;
@cowboy
cowboy / truthy-eq-good-times.js
Created Jun 21, 2011
JavaScript: See what == what!
View truthy-eq-good-times.js
// This should do a pretty good job of iterating through the following array
// and logging any values that == each other. Beware, this is scary stuff!
// http://benalman.com/news/2010/11/schrecklichwissen-terrible-kno/
var arr = [true, 123, {}, {a:1}, [], [0], [123], "hi", function foo(){},
/re/, Infinity, false, 0, "", null, undefined, NaN];
function pretty(v) {
return /^[os]/.test(typeof v) ? JSON.stringify(v) : String(v);
}
You can’t perform that action at this time.