Wrote a small little script when the designers only give me files that are made for iOS with the silly name ending such as @3x.png. According to the scaling guidelines in iOS and Android they should fit pretty nicely without demanding that the designer create new graphics (which they will most likely complain and not do). @3x goes into xxhdpi, @2x goes into xhdpi and @1x goes into mdpi.
Apparently code tags in WordPress doesn’t include spaces. So it’s available on GitHub gists here: https://gist.github.com/davols/3bd1c874a351dcb95308
It’s always great fun to reverse engineer something. Either if you have a goal or just want to have a look at what other people use.
I’ve previously used smali2java with rather good success, but only on smaller projects. And even then there’s a lot of parsing errors. So you end up losing entire (interesting) functions. Besides, it has to run through Wine on my desktop.
Recently came across some other tools that makes it even easier.
It’s remarkably easy and since I’ve used it it’s worked much better than smali2java. Even though it’s a two step process. The User Guide is extremely easy to follow.
Gradle has a bug where the plugin sonar-runner does not work properly. There is a fix in the nightly builds (2.1-rc1) which fixes this issue. However, the plugin android studio uses is way older than 2.1-rc1. And it’s not possible to use the newer gradle binary when building in android studio or outside.
For version control I use gitlab and for continous integration testing I use gitlab-ci. Gitlab-ci uses runners that are decoupled from the server that hosts the code, which for security reasons is great.
So this post is a guide in how to install a gitlab-ci runner with a sonar runner. Tested and working on Ubuntu 14.04.
So I use weechat as my main IRC client. It’s awesome and looks lovely with solarized theme. Running on ubuntu 14.04 and using gnome-terminal there is a problem somewhere that beep.pl doesn’t work. It seems to be some problem in gnome-terminal since the terminal bell isn’t working. I’ve spent countless of hours trying to figure this out. In the end I just thought, to hell with it. Let’s hack beep.pl.
So I looked around for sound files and found a not too long once that sounds pretty decent.
I’m a big fan of awesome window manager on Ubuntu. Got my config on github. Just got my second monitor today and browsing the internet it took some time to find how to move a window to another screen. Be active on the window you want to move and then:
If that doesn’t work look into your
rc.lua and see if you find anything mentioning
Since I moved to Norway the internet I’m able to get at home is pretty shitty. So I decided to order a modem from Ebay. I ordered an unlocked Huawei E398 from Lithuania that has all possible bands used by different providers here in Norway.
However, it’s not plug and play for ubuntu. Even though it was stated from the seller. I tried loads and loads of different kinds of “solutions” (probably solutions to other peoples problem but not mine) online but they all failed. After a while I eventually found it.
LSUSB showed it as
12d1:1505 but network-manager/modem-manager wouldn’t want to recognize it. So it had to change to
12d1:1506. This was a bit weird to fix. I had to create a file named
/etc/usb_modeswitch.d/ As you see below.
$ cat /etc/usb_modeswitch.d/12d1\:1505
And then you had to call usb_modeswitch (I needed root).
usb_modeswitch -I -W -c /etc/usb_modeswitch.d/12d1\:1505
Got the sending working yesterday so I spent some minutes to hack together a small android app in order to control my switches.
Here’s a current sample on the json that the arduino outputs.
Most of the time was used trying to find a good lightbulb icon :(.
Managed to get some progress on the code today. Able to switch on and off several Nexa devices through http. Next stop the android app!
In the meantime I though I could list the stuff I’m using.
- RF Link Transmitter – 434MHz
- Arduino Mega 2560
- Arduino Stackable Header Kit (for wifly)
- WiFly Shield
Some One-wire temperature sensors too but they are not used at the moment.