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 mulberry32(a) { | |
| return function () { | |
| let t = a += 0x6D2B79F5; | |
| t = Math.imul(t ^ (t >>> 15), t | 1); | |
| t ^= t + Math.imul(t ^ (t >>> 7), t | 61); | |
| return ((t ^ (t >>> 14)) >>> 0) / 4294967296; | |
| }; | |
| } | |
| const main = (str) => { | |
| const rng = mulberry32(Math.random() * str.length + 1); |
| class Color implements Iterable<any>{ | |
| private _hex: string; | |
| private _rgba: RGBA; | |
| get hex(): string { | |
| return this._hex; | |
| } | |
| get rgba(): RGBA { | |
| return this._rgba |
| class Mutex { | |
| constructor() { | |
| this.current = Promise.resolve(); | |
| } | |
| async acquire() { | |
| let release | |
| const next = new Promise(resolve => { | |
| release = () => { resolve(); }; |
| 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 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(); | |
| } |
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 | |
| } |
| const _ = require('lodash'); | |
| /** | |
| * File adds a "getNonNull" function to the set of the lodash functions | |
| * function works exactly like `_.get` with one simple exception | |
| * the _.getNonNull returns the default value for null values as well | |
| * just make sure to require this file on your main js/ts file | |
| * | |
| * Example: | |
| * var foo = { bar: undefined: bar1: null } | |
| * with _.get: |
| // Written by Samer Murad | |
| const path = require('path'); | |
| const fs = require('fs'); | |
| const os = require('os'); | |
| class TmpCache { | |
| constructor(ID) { | |
| this.FILE_ID = ID; |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title> Test Progress</title> | |
| </head> | |
| <style type="text/css"> | |
| .progress { | |
| position: relative; | |
| display: flex; | |
| height: 100px; |