Skip to content

Instantly share code, notes, and snippets.

@JunichiIto
JunichiIto / alias_matchers.md
Last active April 16, 2024 16:18
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
@springmeyer
springmeyer / degress2meters.js
Last active June 12, 2023 22:50
convert from long/lat to google mercator (or EPSG:4326 to EPSG:900913)
// See https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames for more details.
var degrees2meters = function(lon,lat) {
var x = lon * 20037508.34 / 180;
var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180);
y = y * 20037508.34 / 180;
return [x, y]
}
x= -77.035974