Skip to content

Instantly share code, notes, and snippets.

@budius
budius / stadia-bt.xboxdrv
Last active March 7, 2023 21:55
xboxdrv configuration for the Stadia controller and auto-select script
# page: https://xboxdrv.gitlab.io/
# manual: https://xboxdrv.gitlab.io/xboxdrv.html
# gitlab: https://gitlab.com/xboxdrv/xboxdrv
# tutorial: https://steamcommunity.com/app/221410/discussions/0/558748653738497361/
# ref: https://lh4.googleusercontent.com/-IYeHo2Xb820/UwaPEr2W-7I/AAAAAAAAGpw/ysXgr-l2o_Q/w462-h383-no/xbox.jpg
# to list devices: ls /dev/input/event*
# to test devices: evtest /dev/input/event<number>
# to find event: sed -n '/Stadia/,/^$/p' /proc/bus/input/devices
# and grep it : sed -n '/Stadia/,/^$/p' /proc/bus/input/devices | grep event
@budius
budius / stream_listener_widget.dart
Last active March 10, 2020 12:26
A Widget that subscribes/cancels to a Stream and dispatch the events to the supplied listen function.
/*
MIT License
Copyright (c) 2020 Ronaldo Pace
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:
The above copyright notice and this permission notice shall be included in all
@budius
budius / git_delete_merged_branches.sh
Last active November 15, 2019 11:03
Delete merged branches
git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d
@budius
budius / git_remove_white_spaces.sh
Last active November 15, 2019 11:03
Remove white spaces from GIT
git diff -w --no-color | git apply --cached --ignore-whitespace && git checkout -- . && git reset
@budius
budius / gif_it
Created November 15, 2019 11:02
Create GIF from video using FFMPEG (optimised for mobile screen recording)
#!/bin/sh
ffmpeg -i $1 -r 15 -vf "scale=720:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" $1.gif