Skip to content

Instantly share code, notes, and snippets.

View rpavlik's full-sized avatar

Rylie Pavlik rpavlik

View GitHub Profile
@rpavlik
rpavlik / generate.sh
Created September 6, 2017 14:20
STM32F103xB scripts/generate.sh script for xpack/micro-os-plus usage
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# Sample scripts/generate.sh file for use of xPacks on an STM32F103xB,
# such as that found on the Nucleo F103RB (only minor changes required for other F1 chips),
# using my "unofficial" xPacks of the HAL and CMSIS device code.
# Based on a combination of these files:
# https://github.com/micro-os-plus/eclipse-demo-projects/blob/master/f4discovery-blinky-micro-os-plus/scripts/generate.sh
@rpavlik
rpavlik / additions_to_config.cson
Created March 8, 2017 19:34
Markdeep customizations for Atom
# Merge (don't replace!) the contents of your config.cson Atom configuration file with this
# to improve support for Markdeep. This is the best I've found so far, but not ideal.
# Markdeep: https://casual-effects.com/markdeep/
"*":
core:
customFileTypes: # Merge contents of these keys with any existing config
'source.gfm': [
'md.html' # Recommended file extension for Markdeep - maps here to GitHub-Flavored Markdown.
]
@rpavlik
rpavlik / find-included-cmake-modules.sh
Last active October 12, 2016 22:39
Somewhat hacky, but semi-functional, way of searching for included CMake modules from a directory.
#!/bin/sh
# first grab the lines that have an include command,
# then filter out the ones where it might be commented out (this might over-filter - can drop this stage)
# then, use sed to grab just the stuff in between () in the include statement
# and finally, sort/uniq.
ag --nofilename 'include[(].*' | \
grep -v '#.*include[(]' | \
sed -r -n 's/.*include[(]([^)]+)[)]/\1/p' | \
sort --unique
@rpavlik
rpavlik / PushBulletBookmarklet.js
Last active October 30, 2020 16:41 — forked from Ashish879/PushBulletBookmarklet.js
PushBullet Bookmarklet
(function() {
var API_KEY = "YOUR_API_KEY_GOES_HERE";
// code for IE7+, Firefox, Chrome, Opera, Safari - forget IE6
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("POST", "https://api.pushbullet.com/v2/pushes", true);
xmlhttp.setRequestHeader('Content-Type', 'application/json');
xmlhttp.setRequestHeader('Authorization', "Bearer " + API_KEY);
/// @todo needs oauth2 update? ugh.
@rpavlik
rpavlik / GetRenderManager.cmd
Last active February 23, 2022 11:53
Batch script for keeping an up-to-date local copy of the latest 32 and 64-bit continuous builds of OSVR RenderManager and OSVR Core
@echo off
rem By Ryan Pavlik, Sensics, Inc. <http://sensics.com/osvr>
rem Copyright 2015-2016 Sensics, Inc.
rem SPDX-License-Identifier: Apache-2.0
rem Put this in a directory of its own, preferably. It will create one file and two subdirectories.
rem Doesn't hurt to run it more often than there are builds: it won't re-download (though
rem it will harmlessly re-extract)
rem Requires that you have wget and 7za (the command line version of 7z) in your path.
@rpavlik
rpavlik / chomeos-dmesg.txt
Created May 15, 2016 17:24
dmesg from aces cb5-311 - see breakpoints
crosh> dmesg
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 3.10.18 (chrome-bot@build35-m2) (gcc version 4.9.x-google 20150123 (prerelease) (4.9.2_cos_gg_21201ea_4.9.2-r117) ) #1 SMP Wed Apr 27 13:19:33 PDT 2016
[ 0.000000] CPU: ARMv7 Processor [413fc0f3] revision 3 (ARMv7), cr=30c7387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
[ 0.000000] Machine: NVIDIA Tegra SoC (Flattened Device Tree), model: Google Nyan Big Rev 3-7
[ 0.000000] Memory policy: ECC disabled, Data cache writealloc
[ 0.000000] On node 0 totalpages: 516074
[ 0.000000] free_area_init_node: node 0, pgdat c0e5d800, node_mem_map c0f04000
@rpavlik
rpavlik / check-steamvr-driver-interfaces.sh
Created May 2, 2016 19:20
SteamVR driver interface strings - script and output
#!/bin/sh
# Script to search and print SteamVR-style "interface strings"
# (things like IServerTrackedDeviceProvider_003) found in Valve SteamVR drivers,
# to verify that they match the interface strings in the publicly-available
# OpenVR headers
# Run it in something unixy - git bash works.
# Change as appropriate
@rpavlik
rpavlik / PKGBUILD
Created April 19, 2016 20:12
PKGBUILD for libfunctionality on MSYS2 MinGW
# Maintainer: Ryan Pavlik <ryan@sensics.com>
_realname=libfunctionality
pkgbase="mingw-w64-${_realname}"
pkgname="${pkgbase}-git"
provides=("${pkgbase}")
pkgver=v0.1.r17.g315e786
pkgrel=1
pkgdesc="A minimal library for dynamically-loaded or statically-linked functionality modules. (git) (mingw-w64)"
arch=('any')
@rpavlik
rpavlik / ValveStrCpy.h
Created February 25, 2016 22:35
Stick a std::string in a buffer that a Valve API gives you, as safely and portably as possible.
/** @file
@brief Header
@date 2016
@author
Sensics, Inc.
<http://sensics.com/osvr>
*/
@rpavlik
rpavlik / ComputeGenerator.groovy
Last active July 13, 2016 19:21
Compute the CMake generator for Windows (for use in Jenkins, for instance) based on some orthogonal environment variables.
/* ComputeGenerator.groovy by Ryan Pavlik - maintained at https://gist.github.com/rpavlik/3ad0e691e5d51606bd67 */
/* Uncomment the following for testing purposes only */
/*
VS='12'
BIT='64'
*/
/* should give result [GENERATOR:Visual Studio 12 2013 Win64] */