Skip to content

Instantly share code, notes, and snippets.

View Wollw's full-sized avatar

David E. Shere Wollw

View GitHub Profile
@Wollw
Wollw / gamepad.c.diff
Last active June 19, 2022 17:39
Diff to add support to xone for the 8BitDo Ultimate Wired Controller for XBox's Share button.
17a18,21
> /* vendor/product ID for 8BitDo Ultimate Wired Xbox */
> #define GIP_GP_VID_8BITDO 0x2dc8
> #define GIP_GP_PID_8BITDO_ULTIMATE_WIRED_XBOX 0x2002
>
258c262,268
< input_report_key(dev, KEY_RECORD, !!pkt_xs->share_button);
---
> u8 share_button;
> if (client->hardware.vendor == GIP_GP_VID_8BITDO &&
{-# LANGUAGE DeriveDataTypeable #-}
import Codec.Picture
import Data.Numbers.Primes
import System.Console.CmdArgs.Implicit
import Prelude hiding (exponent)
import System.IO
import System.Exit
data Options = Options
{ exponent :: Double
#!/usr/bin/env python2
"""
SYNOPSIS
video-rotate [-h,--help] [-v,--verbose] [--version]
DESCRIPTION
Rotate a video around the x-axis. Frames are output as PNG files
but can be reconstructed into a video with ffmpeg or another
@Wollw
Wollw / vf_sort.c
Last active January 1, 2016 17:09
thrown together sorting filter for ffmpeg
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
# Eli Dai a11062387
# VIS 198 assignment 2
import pygame
import hashlib
import jobD
class Render:
def __init__(self):
return
@Wollw
Wollw / gist:5562069
Created May 12, 2013 01:37
Scale video using FFMpeg
#!/usr/bin/perl
#####
#
# This script scales an input video to be the duration provided.
#
# usage:
# scale-video.pl [-a audiofile] [-b bitrate] -d hh:mm:ss infile outfile
#
# The bitrate should be in kbps
@Wollw
Wollw / main.c
Created February 18, 2013 04:03
#include <stdio.h>
#include "serial.h"
#include <avr/pgmspace.h>
int main(void) {
serial_init(19200);
int i;
char buffer[8];
@Wollw
Wollw / pe_45.hs
Last active December 12, 2015 08:59
Project Euler Problem 45 This is mostly unoptimized and terribly slow. Takes about 40 seconds on my i5-3320M.
-- Project Euler Problem 45
--
-- Triangle, pentagonal, hexagonal
--
-- Triangle, pentagonal, and hexagonal numbers are generated by the following formulae:
-- Triangle Tn=n(n+1)/2 1, 3, 6, 10, 15, ...
-- Pentagonal Pn=n(3n−1)/2 1, 5, 12, 22, 35, ...
-- Hexagonal Hn=n(2n−1) 1, 6, 15, 28, 45, ...
--
-- It can be verified that T285 = P165 = H143 = 40755.
@Wollw
Wollw / pe_36.hs
Last active December 12, 2015 06:19
-- Project Euler Problem 36
-- Double-base palindromes
--
-- The decimal number, 585 = 1001001001 base 2 (binary), is palindromic in both bases.
--
-- Find the sum of all numbers, less than one million, which are palindromic in
-- base 10 and base 2.
--
-- (Please note that the palindromic number, in either base, may not include
-- leading zeros.)
@Wollw
Wollw / pe_37.hs
Last active December 12, 2015 03:09
Project Euler problem 37 in Haskell
-- Project Euler Problem 37
-- The number 3797 has an interesting property. Being prime itself, it is
-- possible to continuously remove digits from left to right, and remain prime
-- at each stage: 3797, 797, 97, and 7. Similarly we can work from right to
-- left: 3797, 379, 37, and 3.
--
-- Find the sum of the only eleven primes that are both truncatable from left
-- to right and right to left.
--
-- NOTE: 2, 3, 5, and 7 are not considered to be truncatable primes.