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 / 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 / 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 / InlineEdit.vue
Created June 27, 2018 08:49
minimal inline edit vue component
<template>
<div class="editable" contenteditable="true" :placeholder="placeholder" @input="update" @focusin="onFocus" @focusout="checkEmpty"></div>
</template>
<script>
export default {
name: "InlineEdit",
props: {
data: String,
placeholder: {
@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 ){
#include <iostream>
#include <brigand/brigand.hpp>
template<typename Members>
class TaggedTuple{
template<typename TagType>
struct createMember{
using type = typename TagType::type;
};