I recently discovered a very useful PHP function called token_get_all(), which allows you to tap into the Zend Engine that parses PHP (Written in C, so very fast). The function accepts a string, containing PHP code and will return the tokenized output as an array. The array will contain many elements, each of which may […]
Tips & Tricks
WordPress Walker Classes
Walkers are used in WordPress to recursively handle data such as menus. As defined in the WordPress codex The walker class encapsulates the basic functionality necessary to output HTML representing WordPress objects with a tree structure. For instance pages and categories are the two types of objects that the WordPress 2.2 code uses the walker […]
Python Global Vars are Persistent
I was working on my new Python project, a wiki, and was having problems where my code wasn’t being interpreted more than once, or so I thought. I had a menu that changes depending on if the user is authenticated or not, except it never changed. I was on FreeNode IRC’s Django support channel (#django) […]
Page Not Refreshing Properly
I am in the process of building a custom CMS in PHP, using TinyMCE as my Rich Text Editor. I had a odd problem where after saving my changes and being redirected back to my editor, my changes weren’t being refreshed. I had to shift + reload the page to see the new content. I […]
Cannot execute /bin/bash: Permission Denied
If you are running Linux and a service or program returns the error: cannot execute /bin/bash: Permission Denied Or if your users are being logged off as soon as they log in, it’s not a big deal. For me, the fix was setting the suid bit on /bin/login using this command: chmod 4755 /bin/login I’ve […]