Gulp, Bower, and Bootstrap SASS Example App

A few months back I created a tutorial on Setting up Gulp, Bower, Bootstrap Sass, & FontAwesome. If you had problems with the tutorial I’m sorry. Apparently the gulp-ruby-sass npm module I used is undergoing some changes causing the SASS to error out and never compile. I have updated that post to recommend sticking with version ^0.7.1 until v1 stables out.

I’ve also created a GitHub repo with everything setup. This way you can see the exact versions of dependencies I used in the tutorial.

What I do find odd is I had a similar problem with Laravel Elixir a few weeks back. It uses node-sass but something must be going on with the development of both of these plugins. Hopefully, it will all be sorted out and I can stop pulling out my hair.

Call Laravel Artisan Seed From Your Code

There are certain times when using Laravel that you would like to migrate and seed the database. Typically this is done via the Artisan command line tool with:

php artisan migrate --seed

You can also call this in your code with the following:

Artisan::call('migrate', ['--seed' => true]);

Nice and simple but the second parameter always trips me up.

How to setup WordPress with Forge and DigitalOcean

Laravel Forge is a service that handles creating servers on popular cloud hosting providers. I use it to host my WordPress sites with DigitalOcean and to handle auto deployments from a git push.

Installing WordPress on a cloud server you need to plan for failure. Typically there is no guarantee that you will not wake up one morning and find the server just gone. I’ve personally ran into that with AWS in the past and now I always plan for it. Continue reading How to setup WordPress with Forge and DigitalOcean

WordPress Total Words Counter

As the year is coming to a close a lot of sites are creating year in review style posts. I love these because I find it interesting how my stuff compares to them and I try to find little nuggets of information on what I should be doing better.

Alex King has been doing this for the past 9 years and has created a little gist for generating a lot of useful stats.

To take this a step further I wanted to count the total words I published for the year and I put together a little script if you’d like to do the same:

Granted this method is simple and the php function str_word_count is not entirely accurate. If you’d like to get fancy a Word Stats plugin does exist but I found that it wouldn’t work at all with the current version.

Twitter Cards for One-Click Newsletter Signups

Last week I moved my Laravel Newsletter off a self hosted newsletter application and over to Campaign Monitor. While I was working on the move I remembered a post by Ryan Battles on how to integrate one-click Twitter signup and decided to set it up.

Integration was super easy and in fact it would even work with the self hosted app Sendy if you have an SSL. I didn’t.

To get started I filled out all the instructions and downloaded Ryan’s free psd template. A few minutes of customizing and I was up and running.

laravel-newsletter

I pushed the Twitter card live on November 28th and have already seen good results. In five days, around a holiday, I added over 100 new subscribers from just the card. I assume that is a decent number.

I am curious to see how it works over a longer time frame or if this is just a short term gimmick.

11 Tips To Better Phone Photos

I’m still very much a beginner photographer but looking to improve. This post on creating better phone photos has a lot of inspiration:

Behind the emergence of a these incredible mobile photos are countless amazing photographers who – everyday – redefine and push the limits of this new art. And so – we asked the world’s best mobile photographers just how exactly they create art with their phones.

JavaScript Helper for Triggering Stripe Failures

Lately I’ve had to integrate Stripe a few times and I keep having to visit their test card page over and over to copy and paste failed cards. Today I finally had enough and threw together a little helper that you can add to a Laravel blade file.

With this when you view the credit card form you can open console and type stripeData. and have autocomplete of whatever failed message you want to test for.

I know this is super simple but it helped me so I think it’s worth sharing.