Page 2 of 19

Loop list in batches using Twig (or plain PHP)

Recently I had to loop through a series of elements in a WordPress template (thanks Timber), which happened to be using Bootstrap.

If you ever used Bootstrap, you are familiar with the following markup:

The problem here is very common. You have to:

  • Loop every 3/4/n items.
  • Insert a separator or whatever every 3/4/n items.

Continue reading

How to fix: MySQL not starting on MAMP (Pro)

I recently had to install MAMP Pro, in order to do some separate work from my Laravel Homestead VM.

After a weird Mac crash, MAMP would no longer start the MySQL server. This was the data from the logs:

To fix this, go to MAMP, File > Edit Template > MySQL > [version] and add the line highlighted below.

# The MySQL server
innodb_force_recovery = 1

The restart the server. After this you can comment out that line. Hopefully you will now be able to run the server again.

Open a chromeless browser

Today I saw a tweet from Das Surma, where it shows how you can open a chromeless Google Chrome browser. Like this:

How to

  • Open Terminal app
  • type open -n -a 'Google Chrome' --args "--app=[URL]" where [URL] is something like
  • Done!

If you’re curious about what those flags do, -n “Open a new instance of the application even if one is already running.”, -a “Opens with the specified application” whatever that means.

Use only grid system (or other component) from Bootstrap

PSA: You don’t need to add the whole Bootstrap code and a zillion dependencies and plugins just because it’s easier to use col-md-3 than hacking some CSS to float a few divs.

Use the link below to download a customized version of Bootstrap. Need the Grid System? Perhaps the pretty Glyphycons or tooltips? This has you covered:

Customize & Download Bootstrap

HTML0 – A starting point for front-end design

My last post was about front-end design workflow. Since then I got to think that others might benefit from it in a more concrete way.

So here it is, I put everything I use to kickstart a new HTML design project. For lack of time and creativity I named it HTML0. Its main parts are Browsersync + Sass, with a couple of Sass helpers I use frequently.

Any feedback is welcome :)

Fork HTML0 on GitHub.

© 2018 Ignacio Toledo

Theme by Anders NorénUp ↑