It’s really quick tip:
Sometimes you need to make a shell script which need to be executed either on regular basis, or like infinite loop.
You always can run it by:
but if you add a shebang line, the script can be run as standalone application.
//Your php code goes there
Then you can run it like:
Hope this helps
This article is going to explain how to run a Opencart default admin with Joomla Opencart Extensions like jCart and mijoshop. This could apply to any other CMS which provide bridge between opencart and the CMS.
Hey hadn’t wrote anything for a while here, but this is so brilliand and convenient, so I couldn’t resist to share it.
It’s about to check your project for obvious errors before releasing the changes on the production server. I found this answer in StackOverflow, but the solution is for SVN repository and while currently I am working with snv it suits me, but looking forward to migrate to Git, I was thinking “Wasn’t it nice to check the all php files within a folder?”
So here is the solution:
for i in $(find . -iname \*.php ) ; do php -l $i ; done | grep "Parse error"
This should be executed in terminal (at least in Ubuntu it is straight forward) and it print all files which had Parse errors within the folder. I think it’s a must for any php developer who release their code in production server. I already put it as alias in my .bashrc, but I will add it in my “build” script too.
Probably it could be optimized, but for me is pretty much enough.
Over the weekend I had an idea and after day and a half (mostly spent in design) the final “product” is ready. It’s a tool for deadlines.
The idea: It came when I had tough conversation with a client of mine about some money which he owe. I wrote a short email notifing him that if he don’t pay within 2 weeks, we are stopping the supprt and cutting one of his main functionality (since he didn’t pay for it) of his app. And I was thinking: Woudn’t be nice to have a tool which could track the deadline like “You have 14 days, 23 Hours and 30 Minutes to pay is, otherwise – no support” – short and clear. Well this is what the Deadline tool is doing. Here it is:
The main functionaliy: At the first screen you need to select date and time then the deadline is reached as well as the target name and the task (message) which need to be completed. When you submit the form it will create a short url which is the actual counter. This url can be send to the target.
You can also set target’s e-mail as well as yours. If you did it you will receive a mail with a link when the deadline is reached. so both parties will be notified.
Few ideas for deadlines:
- Set deadline for business client (like me :))
- Set deadline to your roommate to move out
- Set your personal deadline to reach some level of income, or career growth
- Set deadline to your govermnent…
Or whatever you imagine. Please use this for fun mostly!
To top it all off, they’re using a badge and points system to encourage people to complete new courses, which is a great way to motivate people to finish what they’re learning and move on to something new. In addition, it also means that as they see their projects come to life, they can show people how far they’ve progressed and encourage a little online competition – which, if you’re a partycasino.com fan, is never a bad thing.
Phone calls aren’t what they used to be. The antiquated system of wires and telephones that once crisscrossed the country becomes increasingly irrelevant as more companies and consumers switch to voice calling over data networks.
Called Voice over IP, this technology uses high speed Internet connections, private networks and internal LANs to deliver enhanced telephone services at a lower price. Very soon, data networks will handle nearly three-quarters of all phone calls. As different types of networks converge, they soon will handle almost every form of communication.
As can be supported by anyone who has ever tried it, starting your own website can be a complicated and somewhat intimidating process. It is not always as simple as just naming your page and uploading content, as there are a number of complex setup-related factors that must go into your site before it is up and functional, at least if you want it to appear professional and well constructed. This is why many people turn to professional companies like Network Solutions, which specialize in website hosting and allow you, not shortcuts, but easier methods for setting your website up the way you imagine it. Continue reading
Saving data with Model->saveAll() is really time savior. There is something specifics while saving multiple records of a single model.
The data provided from the form should be in the numerically indexed array of records like this:
Article] => Array(
 => Array
 => Array
Your code for saving this data with saveAll() should look like this:
Ok, but if you pass only
it won’t work. So if you want to save multiple records of a single model provide the proper data. It took me 1/2 hour to detect that this is the problem.
Of course this is written in the CookBook, but somebody need to read it carefully 😉
Probably everybody know how to match dom elements with css. For example if you want to match all <li> elements. you are doing something like this:
This way every list element will have red text color.
The more advanced example is if you want to select only the active element – an element with a specific class. This way you are adding a style like:
This way only the active elements (list elements with class active) will have red text color.
Ok, but what if we want to match elements which has 2 specific classes?
Let’s say you have following structure:
How to make the first list element to be with red color?
The obvious solution is to add an extra class like this:
but what if there is an easiest solution?
<li class="first second">
As you may notice the css selector which is used is .first.second, so no spaces between them.
This way you can assure that only the element which has class first and second will meet the criteria and will be colorized in red. This notation works with ID’s as well, but basically if you have ID, then you know what is the exact element, so it’s useless, but for selection of two classes I think it really useful.
I would like to know if somebody knew about this way of selecting elements?
I’ve just updated the wordpress plugin called Autocompleter with a new version.
From now on you can change the type of the results in the autocomplete options. The available options are:
- Categories and Tags (default)
- Tags only
- Categories only
- Posts and Pages titles
- Posts titles only
- Pages titles only
Result types can be changed from the admin page of the plugin.
The change has been made, because there were many requests for such types of results and I finally decided to implement them in the official version of the plugin.
If you use it already, just press upgrade automatically, or visit the official page of the plugin.