Skip to content

Instantly share code, notes, and snippets.

View photex's full-sized avatar
🎸
I may be slow to respond.

Chip Collier photex

🎸
I may be slow to respond.
View GitHub Profile
@photex
photex / tangentspace_in_four_bytes.glsl
Created June 7, 2024 09:13 — forked from BeRo1985/tangentspace_in_four_bytes.glsl
Tangent Space just in four bytes (RGBA10_SNORM)
// Copyright 2024, Benjamin 'BeRo' Rosseaux - zlib licensed
////////////////////////////
// QTangent based variant //
////////////////////////////
// The qtangent based variant has a better precision than the octahedron/diamond based variant below.
// 10bit 10bit 9bit for the 3 smaller components of the quaternion and 1bit for the sign of the bitangent and 2bit for the
// largest component index for the reconstruction of the largest component of the quaternion.
@photex
photex / package_builds_vs2017.cmd
Created January 10, 2024 14:36 — forked from aras-p/package_builds_vs2017.cmd
Packaging up Visual Studio & Windows 10 SDK for in-repository usage
@echo off
@rem Packages up VS2017 toolchain into builds.7z archive
@set TOOLS_VERSION=14.13.26128
@cd "%~dp0"
@set VC_PATH=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Professional\VC\
@if not exist "%VC_PATH%" goto error_no_vs
@if not exist "%VC_PATH%"Tools\MSVC\%TOOLS_VERSION% goto error_no_vs
@photex
photex / keybase.md
Last active November 27, 2017 13:42

Keybase proof

I hereby claim:

  • I am photex on github.
  • I am photex (https://keybase.io/photex) on keybase.
  • I have a public key ASCi64jDnQ3IzOTMYIsD82tlgMBDzwobiheqFkxDPV6mYgo

To claim this, I am signing this object:

<?xml version="1.0" encoding="UTF-8"?>
<style-scheme version="1.0" name="base16-ocean">
<style name="Text" foreground="#c0c5ce" background="#2b303b"/>
<style name="Link" foreground="#8fa1b3"/>
<style name="Selection" background="#4f5b66"/>
<style name="LineNumber" foreground="#65737e" background="#2b303b"/>
<style name="SearchResult" foreground="#2b303b" background="#ebcb8b"/>
<style name="SearchScope" background="#343d46"/>
<style name="Parentheses" foreground="#ebcb8b" background="#333333"/>
<style name="CurrentLine"/>
@photex
photex / qtoscsocket.cpp
Created April 4, 2014 16:30
simple osc udp socket in qt5
#include <qtoscsocket.h>
#include <QtCore/qbytearray.h>
#include <QtNetwork/qhostaddress.h>
QOSCSocket::QOSCSocket(QObject *parent) : QUdpSocket(parent) {
connect(this, &QUdpSocket::readyRead,
[=] () {
while(hasPendingDatagrams()) {
QByteArray datagram;
@photex
photex / quick-glut.lisp
Created August 26, 2013 23:34
Template for quick and dirty OpenGL hacking with Common Lisp. Pan with the middle mouse button and zoom with the right mouse button.
(defclass viz-window (glut:window)
((zoom :initform 0.0025)
(offset :initform #(0.0 0.0))
(last-mouse :initform ())
(pan-throttle :initform 5)
(zoom-throttle :initform 0.00025)
(update-mode :initform nil))
(:default-initargs :pos-x 100 :pos-y 100
:width 800 :height 800
:mode '(:double :rgba)
@photex
photex / plant
Created July 2, 2013 23:42
first version of the plant shellscript
#!/bin/zsh
if [ -d ".plant" ]; then
PROJECT=`basename $PWD`
COMMAND=$1
OPTIONS=$@[2,${#}]
else
COMMAND=$1
PROJECT=$2
if [ -d $PROJECT ]; then
import play.api._
import play.api.libs.concurrent.Akka
import akka.actor.Props
import akka.routing.SmallestMailboxRouter
import com.typesafe.config.ConfigFactory
// whatever your package name is and whatever interested actors you want to target
import myapplication.amqp.{RabbitMQConnection, MsgConsumer}
import myapplication.actors.EventFilter
import akka.actor.ActorRef
import com.codahale.jerkson.Json.parse
import com.codahale.jerkson.ParsingException
import com.rabbitmq.client.{Channel, DefaultConsumer, Envelope}
import com.rabbitmq.client.AMQP.BasicProperties
class MsgConsumer(channel: Channel, target: ActorRef) extends DefaultConsumer(channel) {
override def handleDelivery(consumer_tag: String,
@photex
photex / gnome-session-xmonad
Created April 29, 2012 17:05
Xmonad Ubuntu 12.04 Config
#! /bin/sh
exec gnome-session --session xmonad "$@"