Dutch Borrel: Show-Your-Code Meetup
Posted by primeminister | Filed under Cake-Toppings
Finally! The dutch CakePHP meetup number 1 also know as Dutch Borrel.
It will be on Tuesday Jan 12th. 2010 in Amsterdam. To get to know eachother we’re not only talk and drink. We are gonna really meet eachother… through code.
Dutch Borrel #1: Show-your-Code Meetup Amsterdam
AJAX pagination with jQuery and elements
Posted by primeminister | Filed under Cake-Toppings, jQuery/javascript
A simple way to get your paginated data in your view through ajax with jQuery. Thanks to Cesay Dreier and his article at the bakery http://bakery.cakephp.org/articles/view/easy-ajax-pagination-using-jquery.
I changed the code a bit because I use elements in an extensive way. So here is almost the same code but now with an element and some updated javascript code.
I used the latest CakePHP 1.2.5 and did nothing to the layout. So the classes or id’s will be of the default CakePHP layout. I added the blog tutorial posts table and some data.
1. Add to your controller (or AppController):
// my posts controller looks like this
class PostsController extends AppController {
var $name = 'Posts';
var $components = array('RequestHandler');
var $paginate = array('limit' => 10);
function index() {
$this->Post->recursive = 0;
$this->set('posts', $this->paginate());
}
}
Amazon eCommerce datasource
Posted by primeminister | Filed under Cake-Toppings
I just pushed the Amazon eCommerce API datasource to gitHub: http://github.com/primeminister/CakePHP-Amazon-eCommerce-datasource
With this datasource you can easily get listings and items from Amzon in the books, music, etc categories.
You need an access key and secret key from http://aws.amazon.com. Please see the README file in the repository and check the Amazon API at http://docs.amazonwebservices.com/AWSECommerceService/2009-10-01/DG/
Please fork the code if you have optimizations, suggestions, etc. or leave a comment.
Improved music site: Cloudspeakers.com
Posted by primeminister | Filed under Cake-Toppings, jQuery/javascript, Other (tech) stuff
One of the CakePHP projects I have is the site named Cloudspeakers.com. In the last three months we improved the website with new features, gave it a complete new layout and did a lot about the usability.
All is build on the latest stable CakePHP core 1.2 and jQuery 1.3
Read full press release here: http://bit.ly/4zUxj2
Removing cache after shell script is done
Posted by primeminister | Filed under bash, Cake-Toppings
I have a scraper that runs every 6 hours and adds reviews, audio and video of the found music artists to our database. The problem is that I wanted to cache elements and views for minimum of 1 day and let the scraper remove the cache when it found new items.
Firts of all I use file caching. I tried with Clear::cache(false); at the end of the shell script but that didn’t work. I guess the file list is too long.
The I had a simple bash script that just stated
rm -f tmp/cache/views/element*
But the list was too long and it give ‘Argument too long‘ warnings. Then I had a look on the internet (Wait… what is that?) and created my own long-list-removable-view-files-bash-script:
#! /usr/bin/bash find ./tmp/cache -name 'cs_*' | xargs rm -f find ./tmp/cache -name 'cake_*' | xargs rm -f find ./tmp/cache/models -name 'cake_*' | xargs rm -f find ./tmp/cache/models -name 'musicbrainz_*' | xargs rm -f find ./tmp/cache/persistent -name 'cake_*' | xargs rm -f find ./tmp/cache/views -name 'element_*' | xargs rm -f
It does not only views removal, but I use this script also for new release deployment.
After I had finished this @savant pointed me to the PDF Math Curry where he pointed out the same… Damn!! :)
Koffie met cake (Coffee with cake)?
Posted by primeminister | Filed under Cake-Toppings
Update 15 Dec 2009: (NL) De volgende data zijn beschikbaar:
Di 12 Jan 2010, Di 19 Jan 2010 of Do 21 Jan 2010.
‘s middags vanaf 16:00u, Locatie nog onbekend…
Update 09 Dec 2009: It is going to be a ‘Borrel’ in Utrecht. I’m planning dates now…
I have seen many dutch guys (and girls?) in the IRC lately and thought of organizing a Dutch CakePHP get together. So we could do it in two ways: We could make it like a ‘borrel’ starting from like 5pm or we could make it more like a small event with speakers, code and of course cake.
Maybe some belgium and german guys want to be there to?
And of course the first question is: Are you interested in this kind of event/get-together?
“…Gesellig hè!…”
Charlie (aka primeminister)
CakeFest Berlin
Posted by primeminister | Filed under Cake-Toppings
CakeFest was cool. It was good to see all the people that I have met in the IRC channel and finally see some faces with the nicknames.
Amazing was that their were people all over the world! Australias (predominant) and even from Japan (ando). A lot of germans and there were french people, british, americans and of course dutch people. I think I forgot some nationalities but forgive me.
CakeFest started with gwoo giving a talk about Cake in general and how to help out. That saterday had a few interesting talks and also some not interesting ones, but isn’t that always on a day full of talks. It is just IMHO.
Second day I was up to give my talk about Building APIs in CakePHP. The presentation and code is freely available on cakephp.org/downloads together with other presentation and code.
See for yourself! Cheers!