I found this cool side somewhere (sorry whoever I got it from but it's been sitting in my favorites for a while) and it walks you through setting up your Vagrantfile and creates a custom Puppet configuration so it will install all the modules you need.
The part I found interesting is that there is an option named "Box Sync Folder Source" which defaults to "./" (current directory) but you can change it to "../" (the parent directory) and then you can place the directory PuPHPet creates into your project's directory so you don't have to worry about all those extra folders.
I've been using git and GitHub in my workflow for a while now and the only thing that has bothered me about the process is that every time I want to deploy a new version of the site I have to push it to GitHub and then SSH into the server and manually do a git pull
. Needless to say it's a giant hassle.
What I really wanted was a way to just push the commits to GitHub and then have the server automatically pull the updates. Initially, I thought I would just write a crontab script that would do a pull every couple minutes but I knew there had to be a better way. It turns out with GitHub's Service Hooks we can do exactly that. Read More
I was working on a client's website and they wanted to have the color of each of the labels for a group of radio buttons be a different color. If you use $form->setAttrib('class', 'className')
it will set the class for the form element but not for the label. It turns out you need to use $form->setAttrib('label_class', 'className')
and then it will the way you anticipate.
I found this article while looking through the Programmer Reference for Zend Framework 2 on running ZF1 and ZF2 in the same project.
We're very slowly porting a large application from an old system (no MVC framework) into ZF 1. The process is similar but we actually have ZF encapsulating the legacy files so we can use the ZF1 classes in the old code as we convert it. I think after that transition is done we'll start worrying about ZF2. :-)
http://framework.zend.com/manual/2.1/en/migration/zf1_zf2_parallel.html
Awesome site wide license from CSS-Tricks.
http://css-tricks.com/license/
I think this section really embodies what my goals on TPT are:
I don't give two hoots what you do with any of the design or code you find here.
Actually, I do. I hope you take it and use it, uncredited, on a super commercial website and get wicked rich off it. I hope you use it at work and your boss is impressed and you get a big promotion. I hope it helps you design a website and that website impresses somebody you think is super hot and you get married and have smart, chill babies. I hope you use the code in a blog post you write elsewhere and that website gets way more popular and awesome than this one.
and this:
If you copy an entire article from this site and republish it on your own site like you wrote it, that's a little uncool.
Since I started using Vagrant I noticed that I've been having problems with not having enough free disk space. This is mostly my fault because my primary hard disk is running low and I haven't taken the time to clean everything out and reinstall the operating system. When I tracked down my usage, I found that several gigs (I know it's almost nothing but not when you have less then 500 MB free) was being used by VMs created by Vagrant. After some Google searches I found that Vagrant stores the VM files in the default location used by VirtualBox. Below are the instructions for changing this directory.
An excellent article that explains password security and how we should be storing passwords in the database.
http://threetwelvecreative.com/blog/bid/266517/Developers-You-re-Probably-Doing-Passwords-Wrong-Too via reddit
The only thing I would add (and I did in the comments) is that as an added layer of security you can add a site wide salt that is stored in a file. Even if an attacker gets your database, they realize that you're salting your passwords, and they do a brute force lookup they will still be missing information and won't be able to determine the passwords.
I agree with the concept but I disagree with the implementation. I think this problem is best solved using PHP's header function:
header('Content-disposition: attachment; filename="' . $filename . '"');
This works for all browsers and doesn't require any additional javascript or conditional HTML (I always think it's a bad idea).
Hopefully we can use the download attribute in a couple years when the rest of the browsers get caught up.
In all of my Zend Framework applications that have user logins I like to display if the user is logged in and provide a link to login or logout depending on their current state. In Zend Framework 1 it was easy, I would define a function that would get called at the start of every action (_initView()
) and then it would be easy to set any variables that needed to be set on every page.
Then in the layout.phtml file you can easily access the variable like so.
In Zend Framework 2 it isn't as easy.
Nettuts has a nice article that explains PSR-1, PSR-2, and PSR-3. I'm going to do my best to start using these coding standard going forward and I recommend you do the same.
subscribe via RSS