You will get 3000 xp first time your friend opens gifts, after 7 days of opening present you get 10000 xps, 30 days 50000 xps and 90 days 100000 xps.
Wednesday, November 25, 2020
Pokemon Go: Networking - get to level 40 in 90 days!
You will get 3000 xp first time your friend opens gifts, after 7 days of opening present you get 10000 xps, 30 days 50000 xps and 90 days 100000 xps.
Posted by Ivica Ceraj at 7:29 AM 0 comments
Labels: pokemon go friends, pokemon go level up, pokemongo
Tuesday, March 10, 2015
Facebook: All time ranges must be midnights - Not every day is like another, some days are 23h and some are 25h long
Facebook has funny thing about their API. They require timestamps used in their report to be on midnight boundary in your local timezone.
Originally I wrote this code:
facebook_time = DateTime.parse(@run_date.to_s).utc.in_time_zone('America/Los_Angeles').midnight.to_i time_interval="{time_start:#{facebook_time}, time_stop:#{facebook_time+24*3600}}"
That worked great until daylight savings kicked in, and failed with "All time ranges must be midnights", so after a bit of debugging I changed it to this one:
facebook_time = DateTime.parse(@run_date.to_s).utc.in_time_zone('US/Pacific-New').midnight.to_i facebook_time_end = DateTime.parse((@run_date+1).to_s).utc.in_time_zone('US/Pacific-New').midnight.to_i time_interval="{time_start:#{facebook_time}, time_stop:#{facebook_time_end}}"I hope this will help someone spend less time debugging.
Posted by Ivica Ceraj at 7:18 PM 0 comments
Labels: facebook, facebook ads api, ranges must be midnights, ruby
Friday, February 20, 2015
Creating Users and Databases
It is tedious to create database. Well, not really hard, just annoying.
While 3 lines of code to create database, create user and grant user privileges to the database are not hard to write, one needs to remember correct syntax and to place same text 2-3 times.
To mitigate this issue, I created a tiny template to help me with it. It is available at:
Sunday, January 4, 2015
Did you ever wanted to know when a webpage changed?
There is a new web service - WebFollower - what it does is a simple simple, but still important task.
Here is how it works - you sign-up with your Facebook account and go to the dashboard.
On the dashboard you add URLs you'd like to monitor and web follower crawler checks if page has changed. If it didn't than nothing happens and WebFollower's crawler checks it again later. If it did change WebFollower sends you an email notifying you that page changed. If you want to be notified of change when page changes again, you'll need to re-enable it on the dashboard.
That's it - a simple and hopefully useful service.
Monday, August 25, 2014
Setting up ghost on the Openshift
In past few days I decided that I would like to keep track on my progress in how I learn new stuff. After some consideration I hope a good way to organize my work would be to use Ghost: is just a blogging platform funded on Kickstarter last year. I have heard all the hype when Ghost got funded and tried to use it early on, but it was disaster to when it was first released. Also, I didn't have a good use case to keep working at it, but now... here is an opportunity.
Quick googling ghost resulted in number of links as a community seem to be sprouting around it. I read a good introduction on setting it up and on its current features on "Ghost for Beginners". The site covers how to set Ghost on Ghost(PRO), AWS and DigitalOcean, but there was nothing about my favorite hosting solution - OpenShift. So I figured I can write a post on setting Ghost on OpenShift.
At first I tried to set it up using OpenShift's console, but that yielded in an error:
Attempting to install through web interface failed twice, I was a bit discouraged, so finally I attempted to try running rhc command from terminal. That worked like a charm:
rhc app create ghost nodejs-0.10 --env NODE_ENV=production --from-code https://github.com/openshift-quickstart/openshift-ghost-quickstart.git
And here is terminal output:
Application Options
-------------------
Domain: _MY_DOMAIN_
Cartridges: nodejs-0.10
Source Code: https://github.com/openshift-quickstart/openshift-ghost-quickstart.git
Gear Size: default
Scaling: no
Environment Variables: NODE_ENV=production
Creating application 'ghost' ... done
Waiting for your DNS name to be available ... done
Cloning into 'ghost'...
The authenticity of host 'ghost-_MY_DOMAIN_.rhcloud.com (54.82.127.129)' can't be established.
RSA key fingerprint is cf:ee:77:cb:0e:fc:02:d7:72:7e:ae:80:c0:90:88:a7.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ghost-_MYDOMAIN_.rhcloud.com,54.82.127.129' (RSA) to the list of known hosts.
Your application 'ghost' is now available.
URL: http://ghost-_MY_DOMAIN_.rhcloud.com/
SSH to: 53fba91d5004466ac7000306@ghost-_MY_DOMAIN_.rhcloud.com
Git remote: ssh://53fba91d5004466ac7000306@ghost-_MY_DOMAIN_.rhcloud.com/~/git/ghost.git/
Cloned to: /Users/_MY_USER_/Source/ghost
Run 'rhc show-app ghost' for more details about your app.
Ghost correctly appears in the console after that:
Here is a snapshot of Ghost homepage:
I added the user, and published test post:
Thursday, May 22, 2014
FIX: Django, uwsgi, Apache, ProxyPass, host is localhost and using ProxyPreserveHost
I just spent some time trying to figure out how to set our Django application.
Our setup is:
Apache (handles HTTPS and client certificates) is front-end proxy to uwsgi
uwsgi is used to run Django application in the backend.
The problem we faced is that our redirects were broken as links build by django used 'localhost' instead of name of the virtual host. After looking through solutions, and finding some of the issues like:
- Redirect is broken when HTTP_X_FORWARDED_HOST contains multiple hosts
- django.http.get_host() breaks reverse proxying on apache
Posted by Ivica Ceraj at 8:23 AM 0 comments
Labels: apache, django, proxypass, ProxyPreserveHost, reverse proxy, uwsgi
Tuesday, March 11, 2014
MacOSX & Chrome: How to make scrollbars ALWAYS visible in your web application
If you are, like me, annoyed that overflow: scroll does not display scrollbars on all MacOSX computers in chrome; you can actually force Chrome to behave by just adding this to your CSS:
::-webkit-scrollbar {
-webkit-appearance: none;
width: 7px;
}
::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: rgba(192,192,192,.3);
-webkit-box-shadow: 0 0 1px rgba(255,255,255,.5);
}