PHP and big numbers
PHP isn’t friends with big numbers. Wonder where I can stick this number to cause some serious problems.
PHP isn’t friends with big numbers. Wonder where I can stick this number to cause some serious problems.
This is Your Brain on Vim _la casa de kev en Interweb_kev.town
After browsing the web for ages to find a decent solution to backup my server to amazon s3 I finally came across one and I’m just throwing it up here. Reqs: So basically all I need it to do was backup my sites(filesystem and mysql databases) and some config for lighttpd. Implementation: The post I’m basing this off is here Install automysqlbackup using apt sudo apt-get install automysqlbackup Run automysqlbackup as root(just to give it a test) sudo automysqlbackup ...
1)debug_print_backtrace() I use this one a lot, print a debug-style list of what was called to get thethe point where this function is called. Very, very useful. 2) __autoload() Called when you attempt to load a class that hasn’t been defined. the autoloader to attempt an import of xyz.php. Probably not the best technique for readability or clarity in code, but has it uses. 3) ip2long() Don’t store IP addresses as strings on a db use this to store them as a long. ...
One of the many reasons for my love of linux is the idea of keeping config information in simple texts files in the home directory of each user. It all very painless. And now with Dropbox I can have a set of application configurations stored via the web. Using Dropbox, add a folder(I’ve called mine dotfiles) and add in all the useful config files you have. For me it’s my .bashrc (sets up environment stuff, can be iffy with multiple machines however) ...
For anyone wondering how to disable the autocompleter cache in jQuery(meaning you always poll the server each time a letter is entered). Simply set cacheLength: 0, in the autocompleter’s settings. Seems obvious but my googling told me never set this value below 1 or the whole thing would explode. Tried matchSubset etc and nothing else worked. Simple solutions eh?
Why? When you’re faced with an ugly PHP file(or files) with little to do but trawl through it, there is a solution. PHP beautifier is a pear package that will process PHP files and reformat them in a (hopefully) nicer format. Installation You can install it using pear with a very simple pear install PHP_Beautifier Usage Usage is pretty dependent on your needs. What’s nice is, it takes formatting rules as arguments, so if you pass in Pear() as an argument your code will be formatted to the pear standard. ...
For a while now vim has been my editor of choice and only up until recently have I began to unearth it’s potential. My reasoning before was that it was so cross-compatible(even working in ssh terminals) that this would always be my go-to editor. Now it’s become so much more! Running regexes across all working files with bufdo, crazy window manipulation and crazy editing tricks have made this editor truly fantastic. I’ve started using wherever possible, even trying out the vimperator firefox plugin. ...
Download here. What it does Execute commands from google wave on your remote server. How to set it up You need python2.6 or greater, which sucks for a lot of debian users but I need it to be able to kill processes nicely. Fill in the details required here. Deploy it to your own google app engine deployment and continue on the easy option. How it works Using google wave’s api and google’s datastore, when a blip is submitted an xmlrpc request is sent to your server, along with your hashed password for authentication. The python code running on the server is then executed as a sub process and the output is returned. If the server subprocess lasts more than 3 seconds it is killed and that output is returned, I can’t seem to be able to wait any longer before the request times out. ...
So for the last while I’ve been experimenting with PPP as described in Code Complete. Jeff Atwood has a great description of it on coding horror. You should read the blog post the metaphor of pseudocode as tang is a good one. I’ve been using PPP for a number of weeks now and so far it’s really been working. There have been several reasons why I found it worksbut for me the most important and useful part is purely that it slows me down. ...