Disclaimer: Ok, just an idea I thought up. Might take off, might not.
With that out of the way let me introduce snippet of the day. In this thread you may post one snippet of code a day (at most) that you are particularly proud of.
Rules:
Also remember there is no such thing as perfect code, feel free to post improvements (especially to my code). Could also be called a code review thread, so don't post if you don't want to see your code cut up and reassembled. Its all fun, join in. Share your knowledge.
The first one, nothing amazing just something to start with. Im sure you have something cooler.
With that out of the way let me introduce snippet of the day. In this thread you may post one snippet of code a day (at most) that you are particularly proud of.
Rules:
- Snippets must be at most 15 lines long. Try to keep them as short as possible.
- You must have written them yourself and within the course of the day.
- Any language is allowed
- No insulting peoples coding. Although that said, if you just started developing in a language this probably isnt the best place to post.
- Constructuve Critisizm is allowed, just keep it constructive and polite.
- Links to source are allowed
- Editing of constants to increase readability is fine.
- No short replies, use the like feature.
- CSS/HTML and languages similar can be longer, however a link to a demo site must be provided.
- A short explanation would also be cool.
Also remember there is no such thing as perfect code, feel free to post improvements (especially to my code). Could also be called a code review thread, so don't post if you don't want to see your code cut up and reassembled. Its all fun, join in. Share your knowledge.
The first one, nothing amazing just something to start with. Im sure you have something cooler.
PHP:
$sql = $this->table()
->select('MAX(order)')
->left_join(IP::TABLE)
->where(array('lease_id'=>$lease->getId(),'ip_version'=>4));
Last edited: