Skip to content

Instantly share code, notes, and snippets.

View underdoeg's full-sized avatar
💭
I may be slow to respond.

Philip Whitfield underdoeg

💭
I may be slow to respond.
View GitHub Profile
@underdoeg
underdoeg / hx711.py
Last active August 26, 2023 23:33
Python port for RaspberryPI of the HX711 Breakout Board
import RPi.GPIO as GPIO
import time
def createBoolList(size=8):
ret = []
for i in range(8):
ret.append(False)
return ret
@underdoeg
underdoeg / video_player.h
Last active May 4, 2023 14:53
mpv integration into raylib
#pragma once
#include <GLFW/glfw3.h>
#include <raylib.h>
#include <mpv/client.h>
#include <mpv/render_gl.h>
#include <string>
#include <atomic>
#include <cstring>
#include "utils.h"
@underdoeg
underdoeg / PKGBUILD
Created November 1, 2022 09:34
libgda6 arch build script
# Maintainer: Philip Whitfield <public@underdoeg.com>
pkgname=(libgda6)
pkgver=6.0.0
pkgrel=1
pkgdesc="Database access library"
url="https://www.gnome-db.org/"
arch=(x86_64)
license=(GPL)
depends=(gtksourceview3 libxslt python libsecret graphviz goocanvas iso-codes libgee openssl)
@underdoeg
underdoeg / main.cpp
Created April 14, 2017 16:42
Convert a tuple of pointers to a tuple of references
#include <tuple>
#include <iostream>
template<typename ...T, size_t... I>
auto makeReferencesHelper(std::tuple<T...>& t , std::index_sequence<I...>)
{ return std::tie(*std::get<I>(t)...) ;}
template<typename ...T>
auto makeReferences( std::tuple<T...>& t ){
@underdoeg
underdoeg / circle.gd
Last active July 22, 2020 16:26
Draw a circle within Godot
tool
extends Control
var color_internal:Color = Color.red
export var color:Color = color_internal setget _set_color, _get_color
var res_internal:int = 50
export var resolution:int = res_internal setget _set_resolution, _get_resolution
@underdoeg
underdoeg / PKGBUILD
Created January 26, 2020 17:38
Figaro's Password Manager 2 beta aur build
# Contributor: TDY <tdy@gmx.com>
pkgname=fpm2
pkgver=0.90dev2
pkgrel=1
pkgdesc="Figaro's Password Manager 2"
arch=('i686' 'x86_64')
url="http://als.regnet.cz/fpm2/"
license=('GPL')
depends=('gtk2')
@underdoeg
underdoeg / PKGBUILD
Last active January 24, 2020 10:28
godot 3.2 beta PKGBUILD
# Maintainer: Ivan Fonseca <ivanfon@riseup.net>
# Modified by: Philip Whitfield <public@underdoeg.com>
pkgname=godot-beta-bin
pkgver=3.2_rc3
pkgrel=1
pkgdesc="The latest official beta release of the Godot game engine"
url="https://godotengine.org"
license=("MIT")
arch=("i686" "x86_64")
@underdoeg
underdoeg / mapping.py
Last active November 12, 2019 14:13
HDE PS2 controller mapping for linux
from __future__ import print_function
import hid
import time
import uinput
buttons = [
uinput.BTN_START,
uinput.BTN_SELECT,
uinput.BTN_NORTH,
@underdoeg
underdoeg / pam_authenticate.cpp
Created August 8, 2019 11:41
test user auth with pam on linux
#include <security/pam_appl.h>
#include <security/pam_misc.h>
#include <string>
int pam_conversation(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr) {
auto pass = static_cast<std::string *>(appdata_ptr);
auto reply = (struct pam_response *) malloc(sizeof(struct pam_response));
reply->resp = strdup(pass->c_str());
reply->resp_retcode = 0;
*resp = reply;
@underdoeg
underdoeg / ofxRaspberryPiWindow.cpp
Created October 25, 2012 19:15
basic openframework window to run on the raspberry pi (.cpp file)
/*==============================================================================
Copyright (c) 2011, 2012 Christopher Baker <http://christopherbaker.net>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: