Skip to content

Instantly share code, notes, and snippets.

View sadez's full-sized avatar

Salim Aboubakri sadez

View GitHub Profile
@sadez
sadez / file.js
Created August 9, 2022 08:53
file for map
/**
* Create a map with a marker.
* Creating or dragging the marker sets the latitude and longitude values
* in the input fields.
*/
// We'll insert the map after this element:
var prev_el_selector = '.fieldWrapper#field-id_longitude';
// The input elements we'll put lat/lon into and use
@sadez
sadez / getURLFromCDN.js
Last active June 4, 2020 14:59
get url CDN
const getURLFromCDN = (imageURL, height, quality) => {
// url formatting depend on CDN
return `${CDNimagePath}/${imageURL}?height=${Math.round(height)}&format=jpg&q=${quality}`;
};
// render
<FastImage
source={{ uri: getURLFromCDN("https://url/image.png", 200, 80) }} // https://cdnurl/https://url/image.png?height=200&q=80&format=jpg
style={imgStyle}
/>