Scraping web with python and selenium

A couple of weeks ago, I had a need to parse some parts of some web page. It was a page whose main content is loaded after finishing the GET request to the page. This means that python's urllib, urllib2 and requests packages will fail to download the exact same…

Some handy Android code snippets

Email Validation public static boolean validateEmail(String email) { return android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches(); } Share Button Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND); sharingIntent.setType("text/plain"); Resources res = activity.getResources(); String shareSubject = res.getString(R.string.share_subject); String shareVia = res.getString(R.string…

How to update nodejs on Ubuntu (Debian)

Thanks StackOverflow! First method: Through NPM sudo npm cache clean -f sudo npm install -g n sudo n stable node -v Second method: Through NVM curl https://raw.github.com/creationix/nvm/master/install.sh | sh source ~/.profile nvm install 0.10.26 nvm use v0.10.26 which node…

Use Google App Engine Applications with Custom Domains for free

I like free. Looked for a good resource to achieve this. However, most of them are outdated and they say that to be able to use GAE apps with custom domain, you need a Google Apps account no you don't. Plus, if you add your appid.appspot.com to your…

Deploy web.py applications with pip requirements on Heroku

Running and deploying python apps on Heroku is pretty easy. I usually use web.py and Jinja2 templates for a typical web server. Install heroku toolbet Login to heroku heroku login Set the environment variables heroku config:set PORT=8080 Heroku clone the app from created path. heroku git:clone…

How I store server logs in Google Spreadsheets

Disclaimer: I'm not an expert in this field. I just want to share my experiences with logs, you are welcome to give some feedback on my method. I like logs, I hate logs. I like analyzing them but I don't like dealing with backups and everything. I have small sized…

Got my new toy - OnePlus One

I finally got my OnePlus One after a long waiting for an invitation. I have been using it for 2 weeks. Pros Price price price. it's a giant phablet. Gorgeous design. people are asking me all the time what phone this is. I started to like back cover. some people…

Ghost v0.5 update problem - No support for database client postgres

Error line from logs: ERROR: No support for database client postgres If you are using postgres (usually for heroku users), just change your config.js file from: production: { url: 'http://hakanu.net', mail: {}, database: { client: 'postgres', to production: { url: 'http://hakanu.net', mail: {}, database: { client: 'pg', Redeploy your ghost.…

Use third party python packages in Google App Engine

My hacky solution of usage of 3rd party packages in python. If you have a better method, leave a comment! Let's start with flask example package by google. git clone https://github.com/GoogleCloudPlatform/appengine-python-flask-skeleton.git cd appengine-python-flask-skeleton pip install -r requirements.txt -t lib dev_appserver.py . Visit localhost…

Deploying Meteor and high cpu usage on production

Meteor is an open source javascript framework which gives developers to create real time Web apps without dealing with server code. From my side it's a lot like firebase. However there are slight differences between them. Firebase also supports server side data synchronisation. Even though I don't really like nodejs…