Category Archives: Web Development

Chrome Developer Tools now Open on Right opposed to Opening on the Bottom

If you’ve downloaded a recent beta or canary build of Google Chrome you may notice that sometimes the “developer tools” seem to open at the right instead of at the bottom. If you’re not using a large, wide-screen monitor you may find this inconvenient. Unfortunately it seem the Chromium Developer’s personal preferences have to come before user-experience. If you want the default setting for the position of Chrome’s Developer tools to be customizable, you’re out of luck. It will attempt to use your last-used preference, but you’ll notice that with incognito mode it will always end up being on the right. Because it is more convenient for the developers, and easier for them to change a default value string rather than code in an actual preference. Wouldn’t it be nice to do this: Unfortunately, that is not currently available. So what should you do? Star it, and complain about it here.

Posted in Tech Tips, Web Development | Tagged | Leave a comment

How to use http_get_request_headers with PECL_HTTP version 2

If you’re using the version 2 pecl_http (possibly version 2.0.6?) on your webserver, perhaps Ubuntu or CentOS, with PHP5, maybe 5.3, 5.4, or 5.5, you may have noticed that after getting it all installed and adding this to your php.ini file: extension=raphf.so extension=propro.so extension=http.so But then when you try and use the function get_request_headers() you end up getting: PHP Fatal error: Call to undefined function http_get_request_headers() Well, when this extension switched to pecl/http v2 it changed a lot of things, and global functions was one of them. It now uses namespaces, and so instead of using http_get_request_headers() you’ll need to use something like this: $headers = \http\Env::getRequestHeader(); print_r($headers); The check out the docs for more details on how to use the new function, basically you’ll see getRequestHeader: Retrieve one or all headers of the current HTTP request. Parameters: Optional string $header_name The key of a header to retrieve. Returns: NULL, if $header_name was not found string, the compound header when $header_name was found array of all headers if $header_name was not specified

Posted in Web Development | Tagged , | Leave a comment

Video Modal Popup similar to Apple.com for HTML5 video

I wanted to know “Are there any open source tools to create modal popups for videos like the ones used on apple.com ?” I wanted something to do video popups in a modal like those on Apple.com – for product videos, etc. I was looking for how the popups are done on the main website – not the regular dialog popups on the apple “store” site. After a lot of looking I found SublimeVideo which is not open source but it is free. So, if you need it for popping up a video like how the main apple website does their videos, check out SublimeVideo and click on “lightbox”: The customization is really easy and it is really easy to add multiple video sources / formats to have both low and high def ( HD ) video and posters, as well as a nice javascript API to interface with the video player.

Posted in Web Development | Tagged , | Leave a comment

QSFoundation/QSFoundation.h file not found – Building Quicksilver Plugins

Ok, so you’ve read the getting started guide on how to write quicksilver plugins, and read the QSApp Blog Post about how to get started with QS plugins, and checked out the Quicksilver Plugin Development Reference and checked out the repo of current plugins and visited the Quicksilver Developer Wiki and already referenced the Quicksilver Plugin Reference and read PJRobertson’s Quicksilver Plugin Reference page and now you have got your new Xcode project all setup and when you click “build” you get something like: QSFoundation/QSFoundation.h file not found – Building Quicksilver Plugins Here’s what to check Make sure that in Xcode5 you have set up the SourceTrees in the preference pane – it’s under Locations -> Source Trees: Secondly, you should have also already used git to clone the Quicksilver repo and built Quicksilver successfully. For help on this topic see Building Quicksilver. Finally, you must have built Quicksilver for development in order for the header files to be in the right places. Here’s how to build for development: To check and make sure the headers are in the correct place, check this folder: /tmp/QS/build/Debug/QSFoundation.framework/Headers/ It should exist and not be empty. For more help visit Quicksilver’s Google Group or open a support request on the Github page.

Posted in Web Development | Tagged | Leave a comment

Gravity Forms – Disable and Remove the “Map It” Link

In the Gravity Forms generated emails, if your form has a “address” field the email notification generated by using something like {all_fields} will have a “Map It” link associated with the address, which will open Google Maps. Add this code to your theme’s functions.php file to disable / remove the “Map It” link from the email notification. // code courtesy of https://techblog.willshouse.com/?p=5249 add_filter(“gform_pre_send_email”, array($this,’gform_pre_send_email’)); function gform_pre_send_email($email) { // attempt to match the link using a regular expression $test = preg_replace(“#\<a [^>]+?\>Map It[^>]+\>#i”, ”, $email[“message”]); // if the result is not empty / blank, use it to replace the original html if(trim($test)) { $email[“message”] = $test; } return $email; } If you want to hide the “map it” link from the HTML that is displayed on a webpage ( if you confirmation has the {all_fields} merge replacement in it ) then you can add some CSS like this: <style> a.map-it-link { display: none; } </style></a>

Posted in Tech Tips, Web Development | Tagged , | 1 Comment

fake procmail script

This is similar to fake sendmail. Need a procmail script to deliver messages locally on your machine? Need to do postfix development local for mail ? This will override the “to” field on postfix (more or less) by saving all mail to a local file. Here is a PHP script you can use: Tweak it to fit your needs, adjust #!/usr/bin/php to point to the php file that you use on your system if necessary ( try which php ) The script may need to be in a folder that it has write access to, or that postfix / procmail has write access to. After saving the script to something like /usr/local/fake-procmail.sh edit /etc/postfix/main.cf and add or edit this line: mailbox_command = /usr/local/fake-procmail.sh Also make sure you make the script executable: chmod +x /usr/local/fake-procmail.sh You will also need to route all mail to the localhost by adding these lines: luser_relay = [email protected] local_recipient_maps = mydestination = pcre:/etc/postfix/mydestinations Change johndoe to your user name. Also create a file /etc/postfix/mydestinations and add this to it: /.*/ ACCEPT More info about that here. Then restart postfix if needed: sudo /usr/sbin/postfix stop sudo /usr/sbin/postfix start And try sending a message, or piping some text to the script: echo hello there | mail -s “test message” [email protected] Or echo hello there | /usr/local/fake-procmail.sh There should now be messages in /tmp/procmail-messages/ – change the script to change the location where they are saved. It’s easier than setting up and chrooting postfix on Mac OS X Lion … Continue reading

Posted in Tech Tips, Web Development | Tagged , , | Leave a comment

Is there a Tagboard API?

After reading the Tagboard’s TOS and looking for what they say when discussing APIs, there is only a little bit of information. The TOS mentions APIs in regards that “… agree to the terms of the respective application programming interfaces (API) as follows…” http://developers.facebook.com/ https://directory.app.net/app/114/app-net-api-console/ http://instagram.com/developer/ https://dev.twitter.com/ So, no, it does not appear that they are allowing API access at this point.

Posted in Tech Tips, Web Development | Tagged | Leave a comment

Failed to import Media – Solved

If you’re running WordPress and trying to export and import posts with the WordPress Importer you may be getting an error saying Failed to import Media Fortunately this plugin allows error debugging – you just have to turn it on. You can figure out what is causing the error by turning debugging on. There are two methods for this. First, you can edit the plugin file: /wp-content/plugins/wordpress-importer/wordpress-importer.php Change line 17: define( ‘IMPORT_DEBUG’, false ); to instead be true: define( ‘IMPORT_DEBUG’, true ); You can also edit your wp-config.php file and add this line: define( ‘IMPORT_DEBUG’, true ); That should hopefully help you stop this error: However since the plugin will attempt to redefine a constant that is already defined it may add errors to your log files, which means you should probably use the first method, or just remove line 17 from the plugin file.

Posted in Web Development | Tagged , | Leave a comment

WordPress: Enable Link Manager

Here is how to turn on and re-enable the link manager in WordPress. As of Version 3.5, the Links Manager and blogroll are hidden for new installs and any existing WordPress installs that do not have any links. You might think you need to do something like this: add_theme_support(‘link_manager’); But actually the plugin that re-enables the link manager is but a single line of PHP code: add_filter( ‘pre_option_link_manager_enabled’, ‘__return_true’ ); Which brings back the familiar link manager ( /wp-admin/link-manager.php ):

Posted in Tech Tips, Web Development | Tagged | Leave a comment

DigitalOcean: Private Networking Released

You’ve requested it, and now it’s here! DigitalOcean is happy to announce that all droplets in NYC2 are now equipped with Shared Private Networking, allowing them to communicate with other droplets in that same datacenter. You can enable shared private networking on your Droplet from the Droplet create screen. Traffic sent between Droplets across the private network will not count towards the bandwidth costs and can be used for database replication, file storage, and similar host to host communication. Check out our full length tutorial on how to set-up and use Shared Private Networking. Sign up or login at https://www.digitalocean.com/

Posted in Tech Tips, Web Development | Tagged , , | Leave a comment