This mapping fixes the flipp of the X/Y Triangle/Square buttons on the controller. I needed this fix for game dev and for the PS2 emulator, PCSX2
insert the following line into the game_controller_db.txt file, on macOS, file can be found:
function fixMediumLink(link) { | |
const text = document.createElement('input') | |
text.value = encodeURI(link.replace('sh/embed', 'sh').replace(/sh\/?/, 'sh/embed')) | |
text.select(); | |
document.execCommand("copy"); | |
return text.value | |
} |
This mapping fixes the flipp of the X/Y Triangle/Square buttons on the controller. I needed this fix for game dev and for the PS2 emulator, PCSX2
insert the following line into the game_controller_db.txt file, on macOS, file can be found:
class RateLimiter { | |
public int fps = 100; | |
public bool isActive = true; | |
private float? timer = null; | |
public RateLimiter(int fps, bool immediate = false) { | |
this.fps = fps; | |
if (immediate) this.Invalidate(); | |
else this.Reset(); | |
} |
import {useCallback} from 'react'; | |
import {Alert, Linking, Platform} from 'react-native'; | |
const APPLE_MAPS_LINK = 'https://maps.apple.com/?address='; | |
const GOOGLE_MAPS_LINK = 'https://www.google.com/maps/search/?api=1&query='; | |
type AddressStringFunc = (address: string) => Promise<void>; | |
export const useOpenMapsWithAddress = (): AddressStringFunc => { | |
return useCallback(async (address: string) => { |
class Mutex { | |
constructor() { | |
this.current = Promise.resolve(); | |
} | |
async acquire() { | |
let release | |
const next = new Promise(resolve => { | |
release = () => { resolve(); }; |