Skip to content

Instantly share code, notes, and snippets.

View TimeBandit's full-sized avatar
💭
Waiting to breath

Imrān Nazir TimeBandit

💭
Waiting to breath
View GitHub Profile
@MaerF0x0
MaerF0x0 / gist:7242600
Created October 31, 2013 00:22
Meteor publish and approximate SQL
Meteor.publish(
'scores',
function() {
return Scores.find(
{score:{$gt:100}},
{
fields: {user:1,score:1},
sort:{score:-1},
limit:10,
skip:pageNumber*pageSize
@jeromer
jeromer / compassbearing.py
Last active March 25, 2025 09:32
compass bearing between two points in Python
# LICENSE: public domain
def calculate_initial_compass_bearing(pointA, pointB):
"""
Calculates the bearing between two points.
The formulae used is the following:
θ = atan2(sin(Δlong).cos(lat2),
cos(lat1).sin(lat2) − sin(lat1).cos(lat2).cos(Δlong))