Quick Post, Web Development

Android emulator crashes if proxy is specified

I have to keep note of this, since it’s quite a voodoo bug in Android studio emulator:

If you specify a http proxy in the emulator command line options, the emulator won’t work.

Weirdly enought, the only way to make it work is to specify the -no-audio option:

C:\Users\<your user folder>\AppData\Local\Android\sdk\tools>emulator -avd  <avd-name>-http-proxy 192.168.1.78:8888 -no-audio

The <avd name> is the filename of one of the ini files in C:\Users\<your user folder>\.android\avd, and of course you need to subsitute the address of your proxy server!

Standard
Development, Log

TWIL – Week #40 2014

Random Stuff

  • Spiders do paragliding (balooning, actually). They build a web and use it as a sail to transport themselves.

Bash

  • You can remote copy from ssh servers with scp! Much faster than setting up ftp, http or sshfs.

CSS

GIT

  • Forgot to change branch before editing your working space? No problem, use stash! (this made me very happy)
  • You can authenticate via SSH public key to bitbucket (or any git repo, actually) – no more typing your password!

NodeJs

  • You love iPython notebook? i.js is the same kind of stuff, for javascript. The javascript is actually running on your NodeJs server. Useful to explore your Mongo databases!
Standard
Snippets, Web Development

How to use iPad’s web inspector on Ubuntu 14.04

How to use iPad’s web inspector on Ubuntu

I’ve heard about remote debugging on iPad for quite a while and I used it on windows too; however it’s not so easy to have a similar system on Ubuntu. Hopefully this post will spare you an hour of time while to enable Chrome’s dev tool on your iPad.

This has been tested on xUbuntu 14.04 – but it should work as well on any Debian based OS.

Installation

1) Install dependecies:

1
2
3
4
5
6
 sudo apt-get install \
 autoconf automake \
 libusb-dev libusb-1.0-0-dev \
 libplist-dev libplist++-dev \
 usbmuxd \
 libimobiledevice-dev

Using the default instructions leads to the following message error when trying to start the proxy:

1
Detected an old copy of libplist?! For a fix, see: https://github.com/libimobiledevice/libimobiledevice/issues/68#issuecomment-38994545: Success Unable to start device_listener

Note: previously listed libplist-dev or libplist++-dev are useless, but I do not know which one: if you can tell which one is useless, let me know so I’ll fix the tutorial!

2) download libimobiledevice, since the ones in the Ubuntu repository are outdated; You need the 1.11 series, not the 1.10:

1
2
3
4
5
6
wget http://www.libimobiledevice.org/downloads/libplist-1.11.tar.bz2
tar -xvf libplist-1.11.tar.bz2
cd libplist-1.11/
mkdir ~/ios-proxy
./configure --prefix=/<Your home folder>/ios-proxy/
make && make install

3) Install ios webkit debug proxy using the freshly installed library:

1
2
3
4
5
cd ~
git clone https://github.com/google/ios-webkit-debug-proxy.git
cd ios-webkit-debug-proxy
./autogen.sh
LDFLAGS="-L/<Your home folder>/ios-proxy/lib/" CFLAGS="-I/<Your home folder>/ios-proxy/include/" ./configure --prefix=/<Your home folder>/ios-proxy make  make install

Unfortunately, you still need to call the inspector this way:

1
LD_PRELOAD=/<Your home folder>/ios-proxy/lib/libplist.so /<Your home folder>/ios-proxy/bin/ios_webkit_debug_proxy

4) Launch your browser (chromium works fine) and go to the page http://localhost:9222/.
Be sure your iPad is connected and not seeping and Safari is open: you should be able to see the open pages in your iPad’s Safari and connect to them!

Watch the magic as you hover your mouse on to the inspector and see the live highlight / changes on your iPad!

References:

Standard
Uncategorized

Compile Boostrap from sources in Ubuntu 14.04

Unfortunately, Ubuntu software repos are not up to date with Nodejs.

You shall use Chris Lea’s Repo

sudo apt-get install python-software-properties
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get update

Then, install nodejs:

sudo apt-get install nodejs

Then it’s time for grunt to be installed (that’s  just plain Bootstrap’s tutorial from now on):

sudo npm install -g grunt-cli

Get into your bootstrap directory and run

npm install
npm update

You’re good to go, just run

grunt watch

Also, if you want sourcemaps, see this SO answer.

Standard
Snippets, Web Development

Dynamically generated content loses behaviour in Zurb Foundation

If you dynamically generate or load content in a foundation page, javascript behaviour won’t be automatically attached. Here’s the dirty way to do refresh foundation’s page behaviour:

To reflow all components:

$(document).foundation('reflow')

Or, to reflow just the section component:

$(document).foundation('section', 'reflow')

via github

Standard