Bounga's Home

Running a JSON API with Rack and mruby on a Raspberry Pi

in Raspberry
I recently got a Raspberry Pi 2 so I wanted to experiment with home automation, surveillance system, movement detection and stuff like that.

Thinking of the things I could do with it I quickly realized that I would need an API at home to centralized everything. I immediately thought it was a wor...

Read more...

Setting up Rails, Nginx and Puma

in Unix
When Rails 4 was released it offered a bunch new features and deprecations :



You can see that thread safety is since on by default so a Rack server can safely create threads for your Rails app rather than forking process and waste cpu cycles and memory.

If you didn’t switch to a Rack compatib...

Read more...

Downgrading RubyMotion

in Tips
Sometimes after upgrading RubyMotion I face some bugs introduced in the new release. It can be bugs which can easily be workaround or really annoying bugs that will be pain in the ass in a daily work.

In this case most of the times I choose to downgrade RubyMotion rather than waiting for a new r...

Read more...

Loading shared library in Android using RubyMotion

in Ruby
Problem

Using a vendor library may require to load a shared library (a.k.a .so) along with it to make it work.

I faced this problem when I was trying to use Android PDFView which relies on VuDroid to display PDFs in an Android app.

At the beginning I just added the android-pdfview-1.0.2.jar fi...

Read more...

Force screen orientation in Android using RubyMotion

in Ruby
As you may know since a couple of month you can write native Android apps using RubyMotion.

Last weeks I used it to build an Android app and had the need to lock the screen is portrait mode.

Using the classical Java / XML toolchain to build an app, you have
to add an attribute to your activity ...

Read more...