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
const coords = data.results.map((station) => { | |
const coord = station.geometry.location | |
}) |
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
const data = "results": [ | |
{ | |
"geometry": { | |
"location": { | |
"lat": 41.8921794, | |
"lng": -87.6366551, | |
}, | |
"viewport": { | |
"northeast": { | |
"lat": 41.89363007989272, |
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
export const getNearestDivvyStation = (lat, lng) => { | |
const url = `${GOOGLE_PLACES_URL}?location=${lat},${lng}&radius=1000&type=point_of_interest&keyword=divvy&key=${API_KEY}` | |
return async (dispatch) => { | |
const { data } = await axios.get(url) | |
} | |
} |
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
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=${lat},${lng}&radius=1000&type=point_of_interest&keyword=divvy&key=${API_KEY} |
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
export const getCurrentLocation = (simulator) => { | |
return async (dispatch) => { | |
if (!simulator) { | |
let { status } = await Permissions.askAsync(Permissions.LOCATION); | |
if (status !== 'granted') { | |
dispatch(gotCurrentLocationError('Permission to access location was denied')) | |
} | |
let location = await Location.getCurrentPositionAsync({}); |
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
Test.assertEquals(solve([8,1,2,7],12),true); | |
Test.assertEquals(solve([2,5,4,9,1],90),true); | |
Test.assertEquals(solve([9,8,2],90),true); | |
Test.assertEquals(solve([6,7,3,8],80),true); | |
Test.assertEquals(solve([2,7,4,3],70),true); | |
Test.assertEquals(solve([5,9,7,8,6],90),true); | |
Test.assertEquals(solve([7,1,2,5,4],70),true); | |
Test.assertEquals(solve([1,9,5],90),true); | |
Test.assertEquals(solve([4,9,3,6],90),true); |
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 | |
function mytheme_avoid_fouc(){ | |
echo '<script type="text/javascript">document.documentElement.className = \'js\';</script>'; | |
} | |
add_action( 'wp_head', 'mytheme_avoid_fouc', 1); |
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
<div class="rounded-image" style="background-image:url(link/to/image.png);"> | |
<img class="hidden" src="link/to/image.png" title="This is just for SEO"> | |
</div> | |
.rounded-image{ | |
background-size: cover; | |
background-position: center center; | |
width: 150px; | |
height: 150px; |
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 | |
if ( ! function_exists( 'theme_name_remove_anonymous_object_filter' ) ){ | |
/** | |
* Remove an anonymous object filter. | |
* | |
* @param string $tag Hook name. | |
* @param string $class Class name | |
* @param string $method Method name | |
* @return void |
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 | |
// This is an example of how to include a plugin from the WordPress Plugin Repository. | |
array( | |
'name' => esc_html__( 'WooCommerce', 'text-domain' ), | |
'slug' => 'woocommerce', | |
'required' => false, | |
), | |
// This is an example of how to include a plugin bundled with a theme. |