Skip to content

Instantly share code, notes, and snippets.

View brisbanewebdeveloper's full-sized avatar

Brisbane Web Developer brisbanewebdeveloper

View GitHub Profile
@brisbanewebdeveloper
brisbanewebdeveloper / bookmarklet
Created November 25, 2012 04:14
Bookmarklet - Saturday Gold Lotto Number Importer
javascript:function s(){var data = prompt("Search Text", "").split('|'); var listItems = $('.gameSelectionsDiv'); listItems.each(function() { var items = $(this).find('input.gameSelection'); var d = data[listItems.index(this)].split(','); items.each(function() { var index = items.index(this); console.log(index, d[index]); $(this).val(d[index]); }); });}s();void(0)
@brisbanewebdeveloper
brisbanewebdeveloper / details.txt
Created September 30, 2012 23:52
How to send an email with sendmail (via PHP) on OS X 10.8 Mountain Lion
sudo mkdir -p /Library/Server/Mail/Data/spool
sudo gzip /usr/share/man/man1/{postalias.1,postcat.1,postconf.1,postdrop.1,postfix.1,postkick.1,postlock.1,postlog.1,postmap.1,postmulti.1,postqueue.1,postsuper.1,sendmail.1}
sudo gzip /usr/share/man/man5/{access.5,aliases.5,bounce.5,canonical.5,cidr_table.5,generic.5,header_checks.5,ldap_table.5,master.5,mysql_table.5,nisplus_table.5,pcre_table.5,pgsql_table.5,postconf.5,postfix-wrapper.5,regexp_table.5,relocated.5,tcp_table.5,transport.5,virtual.5}
sudo gzip /usr/share/man/man8/{anvil.8,bounce.8,cleanup.8,discard.8,error.8,flush.8,local.8,master.8,oqmgr.8,pickup.8,pipe.8,proxymap.8,qmgr.8,qmqpd.8,scache.8,showq.8,smtp.8,smtpd.8,spawn.8,tlsmgr.8,trivial-rewrite.8,verify.8,virtual.8}
sudo /usr/sbin/postfix set-permissions
sudo chmod 700 /Library/Server/Mail/Data/mta
sudo /usr/sbin/postfix start
Reference: http://apple.stackexchange.com/questions/54051/sendmail-error-on-os-x-mountain-lion
@brisbanewebdeveloper
brisbanewebdeveloper / gist:3192537
Created July 28, 2012 09:04
configure setting for PHP with PHP-FPM + MySQL + Nginx on iMac having Mountain Lion
./configure --prefix=/usr/local --enable-xml --with-libxml-dir=/usr --enable-exif --enable-ftp --enable-gd-native-ttf --enable-mbregex --enable-json --enable-shmop --enable-fpm --with-mhash --with-xmlrpc --enable-xmlwriter --enable-xmlreader --with-xsl=/usr --enable-zip --with-bz2 --enable-dom --enable-fileinfo --with-openssl --with-mysql=mysqlnd --with-mysql-sock=/tmp/mysql.sock --with-mysqli=mysqlnd --with-zlib --with-gd --with-png-dir=/usr/X11 --with-freetype-dir=/usr/X11 --with-jpeg-dir=/usr/local --with-xpm-dir=/usr/X11 --enable-shmop --enable-sockets --enable-sysvsem --enable-sysvshm --enable-mbstring --with-iconv --with-mcrypt=/usr/local --with-curl=/usr --with-pdo-mysql=mysqlnd
@brisbanewebdeveloper
brisbanewebdeveloper / info.txt
Created July 14, 2012 10:41
Nginx configuration file for using Joomla, Drupal, Symphony under user dirs (Tilde in URL) with PHP-FPM on iMac
My development environment is as follows:
Nginx binary
/usr/local/Cellar/nginx/1.0.15/sbin/ngin
Nginx setting directory
/usr/local/etc/nginx
Nginx plist file
/Library/LaunchDaemons/org.nginx.nginx.plist
@brisbanewebdeveloper
brisbanewebdeveloper / gist:3104742
Created July 13, 2012 12:51
Bookmarklet for searching music quickly at Beatport to tweet !!
javascript:function s(){window.open('http://www.beatport.com/search?query='+encodeURIComponent(prompt("Search Text", "").replace(/\s+[0-9]*\s+[0-9][0-9]?\/[0-9][0-9]?\/[0-9][0-9]|[0-9][0-9]:[0-9][0-9].+$/igm, '').replace(/[^'a-z0-9]/igm, ' ').replace(/(re)?mix|[^0-9a-z]+$/gi, '')), '_blank');}s();void(0)
@brisbanewebdeveloper
brisbanewebdeveloper / gist:3098730
Created July 12, 2012 15:10
How to debug SQL in model class for Joomla 2.5
$db = $this->getDbo();
var_dump($db->replacePrefix((string) $db->getQuery()));
@brisbanewebdeveloper
brisbanewebdeveloper / gist:3098691
Created July 12, 2012 15:05
How to prevent font size to being small in WYSIWYG editor when raw mode for Joomla 2.5
Reference: http://forum.joomla.org/viewtopic.php?f=579&t=707778#p2806094
1. Create a new template by copying bluestork.
2. Open libraries/joomla/installer/adapters/template.php and comment out lines 543 and 558
// $lang->setDebug($debug);
// $debug = $lang->setDebug(false);
 
3. Discover and install the template.
@brisbanewebdeveloper
brisbanewebdeveloper / gist:3098657
Created July 12, 2012 15:02
How to take out the link from the breadcrumbs for Joomla 2.5
// Get rid of the links having specific request from breadcrumbs (this example is targeting the pages using the component Ignite Gallery)
$app = JFactory::getApplication();
$pathway = $app->getPathway();
 
$pathway_list = $pathway->getPathway();
$pathway_list_new = array();
 
$menu = JMenu::getInstance('site');
foreach ($pathway_list as $pathway_item) {