This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { RefObject, UIEvent, useCallback, useEffect, useRef, useState } from 'react' | |
| type GetItemSize = (index: number) => number | |
| type UseVirtualList = ( | |
| count: number, | |
| height: number, | |
| getItemSize: GetItemSize, | |
| ) => { | |
| outerProps: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Usage: | |
| var myLatLng = new google.maps.LatLng(point.lat, point.lng); | |
| var myMarker = new CustomMarker(myLatLng,map); | |
| Implementation (mostly from googles example): | |
| function CustomMarker(latlng, map) { | |
| this.latlng_ = latlng; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function throttle( fn, time ) { | |
| var t = 0; | |
| return function() { | |
| var args = arguments, ctx = this; | |
| clearTimeout(t); | |
| t = setTimeout( function() { | |
| fn.apply( ctx, args ); | |
| }, time ); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // get the url | |
| $url = 'http://' . $_SERVER[HTTP_HOST] . $_SERVER[REQUEST_URI]; | |
| // check if there are any slashes inside the url string | |
| if (strpos($url, '/')) { | |
| // split the string in pieces | |
| // use "/" as separator |