A Developer's Blog

Useful code snippets for you

Hello again,

based on my last article about Simple2Ext I've decided to write another one about Mounts2SD.

Why

I discovered this one those days because of Android 4.2.x and its partition management, simply finding that Simple2Ext is not working anymore on it. So, I had to found another one good replacement of it.

How

It's pretty simple and straightforward to install and use. You have to partition and format you SD card just like I've said in my previous article. Then you have to download and install Mounts2SD directly from the Play Store.
With your MicroSD inserted in your device, open Mounts2SD and configure Busybox and Init.d scripts. After that just simply reboot, and after it finishes to power on (your device will vibrate 3 times) reboot again (just to be sure). Don't worry: your device on you first power on will boot a little longer, because it's moving all the Android framework on your EXT4 partition.

Already done?

Yeah, nothing more to do. If you open up Mounts2SD and the status light is green you're done. If it's yellow, you have to see logs (probably you've not configure it and something else is broken).
This app is made to work upon CyanogenMod 7.x, 9.x and 10.x (so Android 2.2 and up).

Enjoy :)

Fork me on GitHub

Posted on | Posted in Android | Tagged


Good evening guys,

today I would like to show you the evolution of my last discussion about Twig for Wordpres. Since I've studied all the source code and I found more good techniques to implement WordPress API calls, I've decided to create a brand new engine rather than refactoring the old one. So, from this TwigPress have been borned.

You can found more details on the GitHub repo itself on how it works, why have been borned and so on.

I'm really happy of this, since I never liked WordPress Native approach to make templates. With this, I can be more safe and easy to elaborate, play with them and maintain my template markup :)

I hope you'll like it too.

Enjoy, share, help with Pull Requests and report bugs if you found any.
Thank you!

Posted on | Posted in Wordpress | Tagged , ,


Good evening guys,

what I've done those days? Well, today I would like to share with you something cool I've found.

What happens when you love WordPress but you don't like its templating system? There's where the magic happens. You introduce a templating language, more powerful and easy to maintain. And the one I've chosen is called Twig from SensioLabs. I've already managed to use it at work where I do my full job. That's why using it I asked myself "why WordPress team never implemented this?" so I began searching in the net if someone has already started this project.

In fact, with so much surprise, someone has begun this project and is called Timber. Its main goal is to port Twig templating engine to WordPress by using a main theme as "a Twig parser" and a child theme as your main theme for you WordPress based website. In fact it's pretty much cool as a project but no one seems to have maintained it since is from one month to four months old. So, looking at it's code I've seen that it could be optimized and probably rewritten in a much cleaner way. That's why I've decided to fork it make a new one.

Why I'm saying it here? Because any project couldn't be maintained alone, the community has so much power in it, and I would like to have all you contributes into this. I'm currently accepting Pull Requests (if they make sense). Meanwhile which are my current targets?

  • Rewrite all the code base to make it much cleaner
  • Reorganize the project so we wouldn't need two themes in one folder, but one, probably divided by /app and /design folders but I'll look how much free  I could be
  • Port as much WP api natively in Twig (the best option would be to mirror them without having to map them 1-by-1)

So, hoping you would like this, I wish myself I can do this as much faster as I can.

Finally I would like to thank you for all the visits I'm having in this blog. It wouldn't have been what it is without you.

Posted on | Posted in Wordpress | Tagged ,


Hi guys,

first I would like to say sorry for the long time of silence i kept here, but as you may know I'm always a little busy :)  This month I tried to archive so many goals which couldn't be mentioned here, but If you follow me on Twitter you'll be updated with all the projects I'm working on.

By the way, today I would like to share with you some important, small and cool things regarding WordPress itself, since I'm studying hardly those days and I'm trying to find the ways to push it over its limits to keep good performance and speed on my Blog too (yeah, this website). So what did I found that needs a Blog post over here? Obviously I would like to share to you a very good plugin of Caching system called W3 Total Cache.

That plugin will do so much things that you'll never image it. Probably you may already know WP Super Cache and it's beautiful way to cache pages over HTML files on your disk webspace. But in fact this is not sufficient.
As you may know WordPress is made of many more complex things like DB, Po files, plugins, themes and so on, and as long as you add them, the more your HTML will be filled by scripts or css in the HEAD part of you page, or also as inline scripts. So, how can we optimize all of this things? Of course with another plugin that will compact all the other ones!

W3 Total Cache will minify and compress all the HTML, CSS and JS files or inline piece of code that will be embedded on all your website. But it doesn't stop there, it will cache DB queries, output-ed results, static pages and so on. Bringing this to a full blaze of speed to the user that will surf your website. And in fact this is pretty cool because you never have to worry about plugins that will embed scripts here and there. You can forget forever and ever about them, W3 Total Cache will do all the dirty work for you.

But as you may already know, we can optimize as much as we want our website, but our Server bandwidth isn't always free and dedicated to us. That's why I may suggest to you using a Cloudflare CDN free account linked to your WordPress website. How? Simply, with W3 Total Cache! You can find the option to that in the "General Settings" tab of this plugin.

So, you may now think "how much could this speed up things?" well, you're watching it with your eyes already. This website is powered by W3 Total Cache and Cloudflare mixed together :)

Hoping you'll find this article useful, I thank you, and don't forget to share your own experience here after the break :)

Posted on | Posted in Wordpress | Tagged


Hi there,

this is another post update and this I would like to talk to you regarding my new little Python project I've made those days which is called ProjectTreeTemplater.

What is it?

This plugin, made for the award winning Sublime Text 2,  is a simple project tree manager. Imagine yourself creating little template files and trees to manage your project. In fact creating empty files (called placeholders) every time is boring right?
Well, with this plugin you can create it with some simple UNIX path syntax and some other tricks to fully manage your placeholder also with a template files bundled (per file or per extension).

Where can I find it?

As always my projects are open source so you can find it on its GitHub dedicated repository :)

Where can I find the documentation of its usage?

As always, a quality GitHub repo has to come with Documentation, right? I can assure you that ProjectTreeTemplater is as good as the other ones :)

I hope you'll enjoy it as much as I did developing it. Leave your comments down below, but for bugs and features, please use GitHub issue report, so we can track, vote and have an history of what have been done there.

Thanks for reading.

 

Posted on | Posted in Plugins | Tagged ,


Hi again,

since the last post I've made got some movement in the blog and some people refer to it as a "reference" post I thought it would be right to update this argument (like a "what's app regarding the scene of S2") with what happened recently.

As you have already read I made a post regarding my personal experience with my Samsung Galaxy S2, and also if it was not so very much enthusiastic, of that phone, i thought it would be right to share my knowledge with you talking about kernels. But the scene had evolved this months and some good stuff became more good than before and not only in the Kernel scene.

I have to admit that in fact, those months I've tried so much different combinations of ROM + Kernel + Mods to expand my Phone functions (without losing battery life or performance) that in fact I didn't remember all of them. But in those test what I've found was that Dorimanx Kernel (regarding the last post were i was choosing Skyfire Kernels as the award winning) was the best one out in the scene of Galaxy S2. So, why do i changed my mind? Because of two simple "little" facts: Dorimanx's Kernel actually is the best developed (after Siyah of course) in the scene of modding, he has really merged a LOT of Kernel features to the original 3.0.x from major trunks (from 3.1.x to 3.8.x) of official Linux kernel release. This in few words would mean BETTER PERMANCES and BETTER BATTERY MANAGEMENT, things that Samsung would have never thought to do with our phone if you stay on the STOCK ROM. But that's not all, he also listens so much from people asking to him the he actually implemented a new interesting function, which is the Cron Job. What are these things? Actually you can think of your daily routine when you work: you wake up at 8am, you at your office at the 9am, you work until the 1pm and so on. Cron Jobs are just like you, they repeat some tasks at a certain moment of the day, week and so on. But of course, Wikipedia is the right place to better understand this thing ;)
So, what Cron Job brings to our phone? Interesting functions like RAM Cleanup (every hour), AD-Block update (every week), Zip Aling of your Apps (every day) and so on. This in few words can be explained (again) as BETTER PERFORMANCE for your phone. Faster access to your apps and a faster execution of them.

But that's not all, Dorimanx Kernels brings so MUCH features that I cannot list here (so you have to read the official Topic on XDA if you want to). So, how do i know all this things? In fact I'm participating on BETA tests on every Kernel release and I'm personally giving my feedback to him.

Talking about the ROMs I really found that the best which would fit on my Phone is the CyanogenMod one. It actually have EVERYTHING i would need from an Android ROM. Toggles on the Notification Drawer, Stock Android without crapware apps or mods, very FAST and mantained code and in fact, very cool support on XDA too. That's why I chosed CyanogenMod 9 (latest nightly) as my first ROM (didn't I tell you that with Dorimanx you can also install two ROMs?).

Last but not least, which Mod did I choose to install? In fact it's a really good one and it is NOT only for my Phone but it's for ALL mayor Android phones and it's called ACID Audio Engine. What does it simply do? It mods completely your Audio engine. Which means having all major audio features (like Beats Audio of HTC or Clear Bass of Sony) all in one package. Say goodbye the crispy sound, now you have a truly amazing audio experience, your audio will bring up to a completely new life, you'll love your music twice as you did before :)

So, what is my personal setup of the phone that actually is battery friendly and performance killer? You can find the information on my XDA profile in the signature. Every time i change my setup i always reflect them there, so you can visit my profile every time you want.

After all this is my PERSONAL feedback until now. What's yours? Which setup did you found interesting to share? Write back on the comments below and share this article if you liked it.
And...oh I forgot, thanks for reading! ;)

Posted on | Posted in Android | Tagged ,


Hi again,

as always I'm very busy testing things, such as this one I'm going to talk about with you. What my mission was these day was: how to get a fully running WhatsApp on your PC/Mac? Actually officially it is impossible, but using the magic power of Android we can get and accomplish what we are supposed to do. Runing a WhatsApp instance :) So this will be a simple tutorial on how to setup it and how to get working your keyboard whatever your nationality is.

Step 0 - Preamble

The phone number you're going to use MUST exist and CANNOT be fake (because of the SMS activation that will be sent), and cannot be the same where you're already using WhatsApp. Two instances of WhatsApp (one on PC and one on your Smartphone) CANNOT CO-EXIST.

Step 1 - Installation

I'll consider this as a simple task. What you have to do is just download and install the BlueStacks App Player. For anyone who doesn't know what is it, BlueStacks is just an Android app player, a Virtual Machine wrapped for your PC (or Mac) with which you can run from games to regular apps, for Smartphones and/or tablets.

Step 2 - App Stores

After you finish installing it what you have to do is downloading and installing WhatsApp right? But, to accomplish it from any Android Smartphone or Tablet, normally you go to the Play Store and then you search for WhatsApp and after you download and install it. Yeah. pretty the same thing, but here you do not have the Play Store :) Having it means you have been certified from Google, but hey BlueStacks is not a Smartphone or Tablet, so they have to fill the gap, and this is totally done by their 1Mobile Store. You can find it by clicking on "App Stores" on top and after that 1Mobile app.

Step 3 - Download, Install and Configure WhatsApp

So, you opened 1Mobile app store and you found that is pretty similar to Play Store yeah? You're right :) Go fire the search button in the top-right corner of BlueStacks screen and write inside "WhatsApp" and press Enter. You'll be returned with a list of apps matching that name, inside of if you'll find Whatsapp, click on it and then click the Download button.

After the download has finished, you will be prompted to install it. Just as usual press the Install button and you're done.

You finished installing and it and you're in fact ready to configure it. Insert your phone number, follow activation instructions and you're done.

So what you have to do here is just, be sure to use a phone number you're going to use only from Desktop and to share that number with anyone you care to chat with. In fact, you have to add also this numbers to your Address Book, and you can reach it directly by pressing the Menu button in the bottom-left corner of your BlueStacks screen and than doing Manage Contacts.

Step 4 - (OPTIONAL!) Download, Install and Configure the app to map your External Keyboard correctly, whatever your nationality is

So, you finally reached the way to install and use WhatsApp but you found that your Keyboard is not mapped correctly (pressing 'è' will produce '[' and so on). This may happen for example for Italian Keyboards which are NOT implemented by BlueStacks native keyboard mappings. So what you have to do here is simply getting an app from the Store which will do this AUTOMATICALLY for us, but because it's a paid app, I'm going to explain this using the Demo version: the app is called "External Keyboard Helper Demo". Its limitation is that when you press the Space Bar it doesn't make a space but it prints "This is just a Demo" so, to use it fully you have to buy the Pro version.

Open up 1Mobile store and search (as you did already for WhatsApp) for "External Keyboard Helper Demo".

Downoad it and install it as usual by pressing the Install button.

After that you can directly open it or press finish. Let's say you don't want to open it now and you want to configure it later. To do that, after you have installed it you can reach the configuration part of this app using two methods: one is simply going into My Apps and clicking over it in the list.

The other way is entering the settings menu by clicking the Settings button on the bottom-right of your BlueStacks screen and then clicking "Change Keyboard Settings".
After that you have to disable all the other keyboards already installed on BlueStacks my simply unticking the marks on the right and just putting a tick over "External Keyboard Helper Demo". Be careful that using that app will generate this warning, read it and if you're satisfied press Ok and then you can use it, otherwise you cannot and you have to uninstall it.

Aftet that, you can change the Mapping of your keyboard by clicking over "External Keyboard Helper Demo Settings" under the same where you ticked the box. Inside of it you can find all the options you may need.

And that's it!

I hope you'll find this post useful. If you know other ways of getting the mapping of your external keyboard without using such this app (but also easily done without writing the keyboard mapping file manually) write it down here and i'll be glad to edit this post with your method too!

Thank you for reading and share if you like :)

Posted on | Posted in Android | Tagged


Hi guys,

today i would like to share with you this little extension for Google Chrome, that is called YT Native Center Layout.

What is it?

This extension will simply center the Youtube layout, as I personally didn't liked it Left-Aligned, it look old-style and little professional IMHO ;) So, after looking at the Youtube DOM, i found a little trick to center it: in fact seems that Youtube staff did already implement a centered layout so it was as simple as changing in the <body> tag, the class "site-left-aligned" to "site-center-aligned". In fact, this wasn't all.
When you open a video, a little menu on the left appears (called Guide). This one, when website is centered, falled behind the flash player so i had to trick that also with CSS by manipulating the "left" property.
Last but not least, personally i never liked the "white-space" on the right of the video, when you look at it as Wide. So i tricked the CSS again to remove the fixed size and make it "100%".
That's all, and that's what the extension do :)

Can i watch the source code?

Sure! You can see it here, as always in my GitHub Repo. And yeah, it's Open Source covered by GPLv3 License.

Is is available anywhere, for example in the Chrome Web Store?

Yes, you can download it from here :)

That's it!

Thanks for reading. If you liked this, please share wherever you want :)

Posted on | Posted in Welcome


UPDATE: See this one, if you're using Android 4.2 (CM10.x) :)

Hi there,

today I would like to share with you this little Know-How i learnt working all day on this.

What I was trying to do was expanding internal storage (limited to 200MB), the same where you install your ROM/Custom ROM. So, what happen as the time goes by? Simple, it will be filled and soon no empty space will be available. So, what are we supposed to do? Buy another phone? No Sir :) Let's enlarge it just by using some simple steps!

Partition all the things!

First, what we have to do is to partition our SD card, no matter what its size is. BUT we have to make sure that the order of partition are just like this:

  1. The partition where you're going to save your generic data (the same you'll use when you buy an SD and put it inside your phone, for example). MUST be FAT (<=2GB) or FAT32 (>=4GB)
  2. The partition where we're going to put all our apps and Android *heavy* parts like cache and Dalvik-cache. MUST be EXT3 or EXT4.
This way, we're going to have some space available just like it was ROM space. This is where are we going to put some magic :)

Move all the things!

Yes sir! It's time to move all the things there but...how? Simple, just by installing and using Simple2Ext, directly available from the Play Store (it's straightforward compatible with CyanogenMod 7, CyanogenMod 9 and CyanogenMod 10 too).
What we have to do here is just opening the app, ticking all the checkboxes we want (i checked them all as i would like to move all the things from the ROM, letting only the Kernel and some other small tools there) and reboot our phone. That's it! Yes, no jokes :) We're done.

That's all?

Yes.  that's all! You've nothing to do now. Just enjoy your "brand new phone". But remember TO NOT remove your SD Card while your phone is turned ON. Your phone may became unstable and your data may be corrupted. So, if you have to pull it out, remember to TURN IT OFF before doing it.

This method have been tested by myself on Samsung Galaxy Mini, but i think that may work on other Smartphones too.

That's it and as always, thanks for reading :)

Posted on | Posted in Android, Linux | Tagged


Hi,

today i would like you to present this little plugin i've made for you, and I'm of course talking about jQuery iTunes Store Search Plugin.

What it is?

It's a wrapper to Apple Search API which can easily query iTunes Store, Mac App Store, App Store or iBooks Store directly from jQuery. Useful if you would like to make your simple interface for searching apps within your page, or for example embedding your apps in your website.

Where you can I find it?

As always in my GitHub!

That's all!

Really? Yes :) Thanks for reading, I hope you'll enjoy it!

Posted on | Posted in Scripts | Tagged , ,