I haven’t updated this blog in a while and it took me a while to find the repository. And to my shock it was still in bitbucket, I haven’t been there in ages! Surely most of us have already moved our private and personal git repos over to github now that it’s free to host private repositories there. It’s just so much nicer place in my opinion.
Well, to make it more enjoyable to update this blog in the future, I decided to move the repository to github.
The Problem: You need to get the client IP address in the Cloud Code for Geolocation or similar purposes?
It used to be more complicated, now we can just use the request headers as the update below describes.
Update 2017-10-10 There seems to be a fix in Parse server that allows us to read the headers without this workaround.
If you have a recent version of Parse server, you should be able to simply access the visitor IP through x-forwarded-for request header.
Private bitbucket repository as npm dependency In a way that it still works in your choice of Continuous Integration tools.
The Hard Way By using BitBucket’s SSH deployment keys.
Tom Spencer has written a great post about this and I’ve used his method succesfully.
There’s nothing wrong his this approach, I just found it very complicated (for my specific use case) because it requires generating SSH keys, setting them up in BitBucket, and adding extra scripts in your dependant project that set up the SSH keys in the build environment before it can execute npm install.
Disclaimer: This document applies to iOS, I have not tried it on Android.
Parse server has a feature to send push notifications. But for that to work, you need to store device tokens in Parse server somehow from your React Native app. I found that part to be undocumented so here’s my notes on it.
Obtaining device tokens There’s documentation for this already but in case you have not read it, here’s a recap:
Few months ago I got myself Garmin’s newest “Smart Activity Tracker” with an optical Wrist-based Heart Rate monitor and I’ve had it in my wrist ever since.
I think it’s time to write a short review about Vivosmart HRSteps and floors The watch seems to measure steps taken and floors climbed pretty accurately. But so what, I don’t need an exact count, the main point is that they should be comparable between different days so I can challenge myself to do more every day.
Once there was a naïve Mongoose user who tried to run a Mongoose .find() over a whole collection and do operations on all of the documents found there.
OK, maybe it was me, this morning.
First approach It was something like this:
SomeModel .find({}) .populate('someReferences') .exec(function(err, doc) { doStuff(doc); }); Can you guess what happened after that script churned on the collection for a while?
Crash! This happened, node.
Ghost is a blogging platform. Absurd Tech runs Ghost in a FreeBSD AWS EC2 instance.
The usual steps to deploy include: 1. download ghost, 2. unzip it and 3. run npm install in the ghost dir:
$ curl -O https://ghost.org/zip/ghost-0.7.8.zip $ unzip ghost-0.7.8.zip $ cd ghost-0.7.8 $ npm install $ npm start --production Not that easy for us FreeBSD’ers. Especially if you have a somewhat recent version of FreeBSD and its packages.