Skip to content

Instantly share code, notes, and snippets.

View rpavlik's full-sized avatar

Rylie Pavlik rpavlik

View GitHub Profile
local getRoomToWorld = function()
return RelativeTo.World:getInverseMatrix()
end
--- This is a HIDEOUS HACK @todo
local matrixMult = function(a, b)
local val = osg.Matrixd(a)
val:preMult(b)
return val
@willurd
willurd / web-servers.md
Last active May 23, 2024 20:20
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
1. The texture target needs to be GLES20.GL_TEXTURE_EXTERNAL_OES instead of GL_TEXTURE_2D, e.g. in the glBindTexture calls and glTexParameteri calls.
2. In the fragment shader define a requirement to use the extension:
#extension GL_OES_EGL_image_external : require
3. For the texture sampler used in the fragment shader, use samplerExternalOES instead of sampler2D.
Everything below here is all in the C code, no more Java.
4. In the C code, use glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, eglImage) to specify where the data is, instead of using glTexImage2D family of functions.
@vedant
vedant / gist:9333992
Last active May 22, 2024 16:09
Export note files from Google Keep
/* Vedant Misra (vedantmisra.com) (github.com/vedant)
*
* Script for exporting Google Keep note files.
*
* This does not handle attachments or checklists, only note files. Downloads
* each note to a .txt file named for the note's title.
*
* To use this, go to https://drive.google.com/keep/ and wait for the page to
* fully load all of your saved notes; scroll to the bottom to confirm they're
* loaded. Then paste the below in your URI bar, go to the start of the line,
@abayer
abayer / jenkins-git-backup.sh
Last active January 8, 2023 09:19
Example of a script for backing up Jenkins config in git.
#!/bin/bash
#
# Copies certain kinds of known files and directories from a given Jenkins master directory
# into a git repo, removing any old ones, adds 'em, commits 'em, pushes 'em.
#
set -ex
if [ $# -ne 2 ]; then
echo usage: $0 root_dir jenkins_master
@shamil
shamil / mount_qcow2.md
Last active May 21, 2024 09:52
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@cutaway
cutaway / i2c-dump.py
Last active April 27, 2022 13:12
Script to interact with I2C EEPROM memory components using the BusPirate via pyBusPirateLite
#!/usr/bin/env python
# encoding: utf-8
"""
Adapted from i2c-test.py from Peter Huewe by Jean-Michel Picod
Modified by Don C. Weber (cutaway) and InGuardians, Inc. 20141015
This file is part of pyBusPirate.
pyBusPirate is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@rpavlik
rpavlik / .gitignore
Last active February 23, 2016 19:01
run-clang-tidy wrapper for Jenkins
/run-clang-tidy.py
/hudson*
/** @file
@brief Header providing for usage of boost::intrusive_ptr with COM.
Based on the header found at:
<https://github.com/rengeln/nyx/blob/master/src/Prefix.h>
It is essentially the code from the author's blog post,
<http://code-freeze.blogspot.com/2012/02/using-intrusiveptr-with-com.html>
, which describes usage and motivation more. However, it appears to have
some small improvements (mainly in style, and C++11 usage), and usefully,
@rpavlik
rpavlik / OSVR-Data-Flow.md
Created March 30, 2015 16:38
OSVR Data flow doc

Data Flow in the OSVR Core

Ryan A. Pavlik, PhD (Sensics, Inc) - 29 March 2015

Introduction

The OSVR Core, and in particular the server, has among its primary concerns the management of device and analysis plugins, the maintenance of configuration and the semantic path tree, and the routing of input and output data. It conceptually uses a client-server model, though there is almost always a local (same machine) server, and the design does not require process separation. However, for simplicity, the following is written with separate client/server processes.

In important ways, analysis and hardware device plugins are similar, in that both can produce data that a client or an analysis plugin may request. Thus, both types are considered "logical devices", and "device" refers to this general characterization unless indicated otherwise.