All posts filed under: Coding

It’s all about programming!

Delete git files from public GitHub history

Leave a comment
Coding / Howtos

To delete git files uploaded accidentally to GitHub (or any other public repository) do these steps: Download https://rtyley.github.io/bfg-repo-cleaner/ as suggested by GitHub git clone –mirror GIT_REPOSITORY_URL cd path/to/cloned/repository Download BFG java -jar /path/to/download/dir/bfg-VERSION.jar –delete-files filename.ext Run the command specified by BFG (usually git reflog expire –expire=now –all && git gc –prune=now –aggressive) git push If you get an error on pull, probably you haven’t cloned the repository as step 2. Browsing the public history, any […]

Why you should not use Drupal anymore

Leave a comment
Coding / django / Drupal / Python

I’ve started using Drupal on 2007. For about 9 years I visits drupal.org almost on daily basis, I released a module, I suggested some patches, participated to local events and so on. I’ve started working on Drupal with Drupal 5 and I ended on Drupal 7 with a long time on Drupal 6. In the meantime, Acquia was created to support Drupal development and make some money from the project and for the project in […]

A new language for Social Media managers on Twitter

Leave a comment
Coding / Howtos / Python
A screen from JournaKit Followship .ows

Last months I looked for a tool to shape my community on Twitter to follow interesting profiles and to increase my followers. I had bad experiences using integration from third party (app) so I wanted this tool to be able to create my own app on Twitter without 3rd party involvment for better security and privacy. Since I wanted real new followers and I don’t want to violate Twitter policies I looked for a tool […]

Reduce Time to the First Byte – TTFB on web applications

Leave a comment
Coding / django / Python
A typical web application

How to speed up the time to the first byte and what are the causes of a long TTFB? Main causes are network and server-side and I will focus on server-side causes. I’m not covering any CMS here but you can try to apply some of these techniques starting from how to interpret the browser Timing. Get reliable timing Take a website with cache enabled: at the 9th visit on a page you can be […]

From Drupal to Django: how to migrate contents

Leave a comment
Coding / django / Drupal / Howtos / Python

In a recent article I explain the motivations for an upgrade from a no longer maintained Drupal 6 installation to Django 1.8. I will now cover more in detail the migration techniques adopted in the upgrade and I’ll deepen the models and the relationships. Structure If you’re a drupaler, you’re familiar with the node/NID/edit and the node/add/TYPE pages: Here we have two visible fields: Title and Body. One is an input type text and the other a […]

Clear Varnish cache via PHP: a Drupal 7 proof of concept

Leave a comment
Coding / Drupal

Using Varnish as reverse proxy or proxy is an useful approach to reduce the load of webservers like Apache. In Drupal 7 I’ve to clear the varnish cache of a specific domain when Drupal caches are globally cleared. Drupal has the right hook invoked when cache are cleared: Now this piece of code simply adds the current domain to a ASCII text file on /var/www/varnishdomains2cleardir/varnishdomains2clear. Preparing the file to the write On CentOS you have […]

Web fonts and dynamic height calculation issues on jQuery

Leave a comment
Coding

Recently we’ve nice fonts on web pages like Google Fonts and other web fonts. Take this case, you have to set two divs to the same height. One (div.funny) has some text with Google Fonts, the other is empty. On Chrome console you type something like: Div.very and div.funny are now at the same height. Now if you try to do the same on jquery document ready you got elements with different height. Why? Because […]

Web fonts and dynamic height calculation issues on jQuery

Leave a comment
Coding

Recently we’ve nice fonts on web pages like Google Fonts and other web fonts. Take this case, you have to set two divs to the same height. One (div.funny) has some text with Google Fonts, the other is empty. On Chrome console you type something like: Div.very and div.funny are now at the same height. Now if you try to do the same on jquery document ready you got elements with different height. Why? Because […]