This file contains 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
/** | |
* Utility functions: | |
* - getBoundingBox: Gets a box surrounding all points that are a certain distance from provided point on the Earth sphere. | |
* Take care when longitude crosses the 180th meridian. In such case, the minLongitude (e.g., 175) | |
* will be greater than the maxLongitude (e.g. -175). | |
* Credit to Jan Philip Matuschek for the mathematical formulas - http://janmatuschek.de/LatitudeLongitudeBoundingCoordinates | |
* - getDistanceInMeters: Gets a distance between 2 points on the Earth sphere. | |
*/ | |
export type BoundingBox = { minLatitude: number; maxLatitude: number; minLongitude: number; maxLongitude: number } |
This file contains 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
from microbit import * | |
from random import randrange | |
class State: | |
def __init__(self): | |
self.last_frame_time = 0 | |
self.speed = 500 | |
self.snake_pos = [(2, 2)] | |
self.food_pos = (0, 0) |
This file contains 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
$('a').filter(function() { | |
return $(this).text() === 'delete' | |
}).each(function() { | |
this.click() | |
}) | |
links = $('a').filter(function() { | |
return $(this).attr('onclick') === 'change_state(this, "del", hide_thing, undefined, null)' | |
}) |