Skip to content

Author: admin@master

Find closest entries in MongoDB to coordinates

I am having a hard time finding items which are closest to a set of lat/lon. My objects have their lat/lon stored as such: This is the query I am currently using, when I use it I get no results back, not even an empty array. collection.find({coordinates: {$near: [40.296898, -111.694647] }, $maxDistance:100}) …

Dynamically access methods of class TypeScript

I’m trying to access the methods of a class dynamically, using the value of a previously set variable in TypeScript. Something similar to this: For example in PHP I can do the following: Anyone know if this is possible, and if it is, how to do it? I know it slightly contradicts the idea of a typed langu…

Disable input conditionally (Vue.js)

I have an input: and in my Vue.js component, I have: validated being a boolean, it can be either 0 or 1, but no matter what value is stored in the database, my input is always disabled. I need the input to be disabled if false, otherwise it should be enabled and editable. Update: Doing this always enables the…

Add padding-top to scroll when using href=”#id”

I have an anchor tag as follows: It navigates to a section that has the id ‘map_4D85448A3D4C4180A02BD6FC387ABC45’. The jumptosection function is as follows: But even if I write nothing in this function, the behaviour is still the same. The problem is that I have a header strip of 92px that hides s…

Time Based Links in HTMLJavaScript

I’m working on game right now that will have an Item Shop. I thought it would be fun that you couldn’t just walk in at an untimely hour. I made, with a bit of help, this random script (I’m not really sure if this will help) that will let you enter the shop 90% percent of the time. : I