Skip to content

Instantly share code, notes, and snippets.

@xbb
xbb / prestashop-autocompletion.php
Created September 12, 2011 10:12
Prestashop autocompletion
<?php
class AbstractLogger extends AbstractLoggerCore {}
class Address extends AddressCore {}
class AddressFormat extends AddressFormatCore {}
class AdminTab extends AdminTabCore {}
class Alias extends AliasCore {}
class Attachment extends AttachmentCore {}
class Attribute extends AttributeCore {}
class AttributeGroup extends AttributeGroupCore {}
@xbb
xbb / gscrape.js
Created April 2, 2011 15:06
simple google scraper test with phantomjs
var Gscrape = function(domain) {
var domain = domain || 'com',
searchURL = 'http://www.google.' + domain + '/search?q=',
searchInProgress = false,
cache = {
error: '',
success: true,
pages: 0,
urls: {}
};
$('[placeholder]').focus(function() {
var input = $(this);
if (input.hasClass('placeholder')) {
input.val('')
.removeClass('placeholder')
.attr('autocomplete', 'on');
}
}).blur(function() {
var input = $(this);
if (input.val().length === 0) {
@xbb
xbb / jquery.placeholder.js
Created March 10, 2011 09:17
adds placeholder support to browsers not supporting HTML5 placeholders
if ( ! Modernizr.input.placeholder) {
var phId = 0;
$('[placeholder]').each(function(){
var $input = $(this),
label = document.createElement('label');
this.id = this.id || 'input-placeholder-' + (++phId);
label.innerHTML = $input.attr('placeholder');
label.htmlFor = this.id;