I wanted to speed up my coding by adding Laravel 4 Generators and Laravel Artisan plugin for Sublime text 2 (you can learn more about this here). I added "way/generators": "dev-master" to my composer.json file as instructed and ran "php composer.phar update" and waited….and waited…and waited. How can downloading simple text files be so slow when I have very fast connection?
For some reason I always had problems with composers speed – installing or updating dependencies was very slow. By searching net I saw that a lot of people have similar problems and various solutions are offered – for some they work and for some they don’t. I would advise you to try them out and see if any of them help you.
One of the most common advices is to use the --prefer-dist switch:
php composer.phar update --prefer-dist
I ran it however it didn’t help me. Composer got stuck on updating symfony/filesystem dev-master. After 5 minutes I got this error:
The process timed-out.
After trying it few times with the same result I realized that git.exe was having some problems with my network (not sure what). So the problem seems to be with Git protocol, at least in my case. Composers default github-protocols config settings is ["git", "https", "http"]. So what I did was changed github-protocols to https with this command:
Yesterday I noticed that all my Google services were not being synced on my Nexus 7 (Android 4.2.2) anymore. Emails were not automatically downloaded, Calendar,Chrome, contacts etc were not updating. On top of that I was getting weird “Sync was unsuccessful” (or something like that) messages on my PC’s browser. Sure enough – sync was turned off on my Android tablet. For some reason option “turn on sync” is not easily accessible or at least not where you would expect it. If you go to Settings -> accounts then you will only be able to manually sync those accounts but not turn it on.
To turn on auto sync you have to go to
Settings -> Data usage -> Menu (top right corner, 3 small squares) -> check Auto-sync data
While building my new admin/CMS with Laravel 4 and Gebo Admin (really cool twitter bootstrap responsive admin template) I encountered weird problem while using bootstrap tabs – after I added “enhanced select” (Country dropdown) suddenly a horizontal scroll bar appeared!
I am not sure if this is 100% best solution (I am not that keen on digging into all this .js stuff) but the easiest way to fix this is to open Bootstrap.min.css, search for .tab-content and then replace
Reload your page and the horizontal scrollbar is gone.
Note: This post was written while Laravel 4 was still in beta.
When you add a new class (controller) in Laravel 4 you will most probably get
ReflectionException: Class SomeClass does not exist
SomeClass is of course the name of your new class.
Why does this happen? The file/controller is there, the class is there – it works in Laravel 3 so why doesn’t it work in Laravel 4?
The reason for this is that because of the performance reasons Laravel 4 (beta) has a static list of all classes that need to be autoloaded. Since you added your new controller Laravel doesn’t know about it yet. Hopefully this will be automated in the future but right now what you need to do is open your command prompt and type this (on Windows):
If you get 'composer' is not recognized as an internal or external command error or Could not open input file: composer then use this version (also go to your project directory where composer.phar is located):
>php composer.phar dump-autoload
Composer will (re)generate autoload files and your new controller will work.
right mouse-click “My Computer” and select “Properties”
if on Windows 7 then click on “Advanced system settings”,
open “Advanced” tab and click “Environment Variables”,
highlight/click on the “Path” variable under “System variables” and click “Edit”,
add your specific path to front of “Variable value” field or at the end, separated by a semicolon from the existing entry. Do not add a space between ; and last entry.Also, do not add ; after the last entry
Let say, just for example, that the Git.exe is in C:\Users\something\somefolder\bin folder. So when you edit your path variable it should look like this (thanks to my super Photoshop skills you can see that we are on Advanced tab, that we are editing Path variable and that I excel at making watermarks):
A lot of people don’t know that there is an easy way to embed tweets on your site with all the formatting and styling so they look just like on twitter.com. In addition, tweet will also contain avatar, reply,favorite,follow and other buttons so it is also functional.
If you embed only one tweet per page then you can include this line after blockquote. If you embed several tweets then include this line only once, somewhere at the bottom of the page or inside meta tag.