Skip to content

Instantly share code, notes, and snippets.

@dantheman213
dantheman213 / Xbox Controller (Gamepad).txt
Last active Jul 14, 2021
Wii U CEMU Xbox Controller Profiles
View Xbox Controller (Gamepad).txt
# Wii U / Cemu Xbox controller profile
# Located at: cemu\controllerProfiles
[General]
emulate = Wii U GamePad
api = XInput
controller = 0
[Controller]
rumble = 0
@dantheman213
dantheman213 / Xbox Controller (GCPad).ini
Last active Jul 13, 2021
Dolphin Gamecube/Wii emulator / Xbox One Controller profile
View Xbox Controller (GCPad).ini
# Dolphin Gamecube/Wii emulator / Xbox One Controller profile
# Gamecube Controller
# Location -> C:\User\<your user>\Documents\Dolphin Emulator\Config\Profiles\GCPad\Xbox Controller (GCPad).ini
[Profile]
Device = XInput/0/Gamepad
Buttons/A = `Button A`
Buttons/B = `Button B`
Buttons/X = `Button X`
Buttons/Y = `Button Y`
@dantheman213
dantheman213 / elementary_os_install_nvidia.sh
Created Jun 19, 2021
Elementary OS Install NVIDIA Graphics Card
View elementary_os_install_nvidia.sh
# Elementary OS install nvidia graphics drivers
## remove old drivers
sudo apt autoremove nvidia*
## install new drivers
sudo ubuntu-drivers autoinstall
@dantheman213
dantheman213 / pdf.md
Created Mar 21, 2021
Convert PDF into high quality images
View pdf.md
@dantheman213
dantheman213 / average-geolocation.js
Created Aug 23, 2020 — forked from tlhunter/average-geolocation.js
Calculate the center/average of multiple GeoLocation coordinates
View average-geolocation.js
/**
* Calculate the center/average of multiple GeoLocation coordinates
* Expects an array of objects with .latitude and .longitude properties
*
* @url http://stackoverflow.com/a/14231286/538646
*/
function averageGeolocation(coords) {
if (coords.length === 1) {
return coords[0];
}
@dantheman213
dantheman213 / exponential_backoff.go
Last active Aug 11, 2020
Golang exponential back off simple example
View exponential_backoff.go
package main
import "fmt"
import "time"
import "math"
var exponentialBackoffCeilingSecs int64 = 14400 // 4 hours
func main() {
fmt.Println("Hello World")
View update_nodejs_npm_linux.sh
Update nodejs to latest version:
sudo npm install -g n
sudo n latest
Update npm to latest version:
sudo npm install -g npm
Do what @runcible suggested
hash -d npm
View sudo-no-password.sh
echo "username ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
@dantheman213
dantheman213 / ffmpeg.md
Last active Feb 23, 2021
ffmpeg cheatsheet
View ffmpeg.md

ffmpeg cheatsheet

Extract video at 30 seconds in and the duration with be 5 seconds

ffmpeg -ss 00:00:30 -i orginalfile -t 00:00:05 -vcodec copy -acodec copy newfile

Add a watermark logo to the bottom right of the video offset by 30 x 30 from corner

@dantheman213
dantheman213 / bst.go
Created Apr 21, 2020
Golang binary tree
View bst.go
package main
import "fmt"
type Node struct {
Left, Right *Node
Value int64
}
type BinarySearchTree struct {