Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<body>
<canvas id="the-canvas" style="border:1px solid black"></canvas>
<input id='pdf' type='file'/>
<script type="importmap">
{
"imports": {
"pdf": "https://mozilla.github.io/pdf.js/build/pdf.mjs",
@urkle
urkle / README.md
Last active October 23, 2024 08:52
GitHub milestones user script

GitHub milestones user script

What it does

This adds a new milestones nav menu next to pull requests.

Installation

Install Tampermonkey in your broser.

@urkle
urkle / CMakeLists.txt
Last active August 29, 2015 14:12
Copy File cmake function
cmake_minimum_required(VERSION 2.8.12)
function(CopyFile target copy_file dest_path)
if(NOT IS_ABSOLUTE ${copy_file})
set(copy_file ${CMAKE_CURRENT_SOURCE_DIR}/${copy_file})
endif()
set(config )
set(_mode )
foreach(entry ${ARGN})
if(entry STREQUAL "ONLY")
@urkle
urkle / joypad.cpp
Created September 25, 2013 15:21
SDL2 Joystick hot-plugging example
#define MAX_CONTROLLERS 4
class JoypadController {
public:
JoypadController() : m_is_connected(false), m_gamepad(0), m_instance_id(-1), m_haptic(0) {}
int JoypadController::processEvent(const SDL_Event& event);
private:
SDL_GameController *m_gamepad;
SDL_Haptic *m_haptic;