Skip to content

Instantly share code, notes, and snippets.

View dgalli1's full-sized avatar

Damian Galli dgalli1

View GitHub Profile
@dgalli1
dgalli1 / mars.js
Last active June 15, 2021 19:29
Download all Tiles from Google Maps Mars
function getMapUrl(tile, zoom) {
var bound = Math.pow(2, zoom);
var x = tile.x;
var y = tile.y;
// Don't repeat across y-axis (vertically).
if (y < 0 || y >= bound) {
return null;
}
@dgalli1
dgalli1 / force_resolutiuon.lua
Last active September 26, 2020 17:39
MPV Lua Script X11, force resolution on fullscreen
function on_fullscreen_change(name, value)
--[[
xrandr | grep "HDMI-A-0 connected primary 1920x1080+0+0" && echo "true" || echo "false"
xrandr | grep "HDMI-A-0 connected primary 3840x2160+0+0" && echo "true" || echo "false"
--]]
if value == true then
local xrandr_response = os.capture('/usr/bin/xrandr | grep "HDMI-A-0 connected primary 1920x1080+0+0"')
if xrandr_response == "HDMI-A-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 1600mm x 900mm" then
os.capture('xrandr --output DisplayPort-0 --off --output DisplayPort-1 --off --output DisplayPort-2 --off --output HDMI-A-0 --primary --mode 3840x2160 --pos 0x0 --rotate normal')
end
@dgalli1
dgalli1 / setvd.sh
Created November 5, 2019 10:18
Change Virtual Desktop Size Dynamicly
#!/bin/bash
#set the resolution
resolution=$(xdpyinfo | grep dimensions | awk '{print $2}')
echo $resolution
WINEPREFIX=PATH_TO_WINEPREFIX winetricks vd=$resolution
#run the application after the resolution was set
WINEPREFIX=PATH_TO_WINEPREFIX wine PATH_TO_EXECUTABLE
#!/bin/bash
is_running=false
trap ctrl_c INT
function ctrl_c() {
pkill xpointerbarrier
exit
}