####Server Ubuntu 10.04 LTS Lucid
##Process
Install ejabberd
| // mongodb collection generator for getting random documents... | |
| // set to the collection you wish to add a random attribute to. | |
| var collection = 'myCollection', | |
| // the name of the random collection to be generated; what you'll run queries against | |
| // to obtain a random document | |
| randCollection = 'rand' + collection.charAt(0).toUppderCase(), | |
| // wheter or not the random collection should contain full documents, or a truncated | |
| // version of the document (the mongo $_id and random attribute only) | |
| useTruncatedDoc = false; |
| function iterator_map_to_array(\Iterator $iterator, $callback, $use_keys = true){ | |
| foreach($iterator as $i){ | |
| $i = $callback($i); | |
| } | |
| return iterator_to_array($iterator, $use_keys); | |
| } | |
| return iterator_map($cursor, function($i){ | |
| return new MyObject($i); | |
| }, false); |
| var countries = { | |
| AF: "Afghanistan", | |
| AL: "Albania", | |
| DZ: "Algeria", | |
| AS: "American Samoa", | |
| AD: "Andorra", | |
| AO: "Angola", | |
| AI: "Anguilla", | |
| AQ: "Antarctica", | |
| AG: "Antigua and Barbuda", |
| job="@daily which node" && cat <(grep -v "$job" <(crontab -l)) <(echo "$job") | crontab - |
| # Backup your host file | |
| sudo cp /etc/hosts /etc/hosts.bak | |
| # Edit your host file | |
| # See 'hosts.example' for example contents | |
| vim /etc/hosts | |
| # Edit MAMP Apache configuration to include Virtual Hosts configuration |
| <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
| /** | |
| * CodeIgniter | |
| * | |
| * An open source application development framework for PHP 5.1.6 or newer | |
| * | |
| * @package CodeIgniter | |
| * @author ExpressionEngine Dev Team | |
| * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. | |
| * @license http://codeigniter.com/user_guide/license.html |
| <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
| /** | |
| * CodeIgniter | |
| * | |
| * An open source application development framework for PHP 5.1.6 or newer | |
| * | |
| * @package CodeIgniter | |
| * @author ExpressionEngine Dev Team | |
| * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. | |
| * @license http://codeigniter.com/user_guide/license.html |
| <input id="test_input" type="text" value=""/> | |
| <button id="disabler">Disable Input</button> | |
| <script> | |
| $('#disabler').on('click', function(){ | |
| // No callback | |
| // $('#test_input').toggleDisabled(); | |
| // With callback | |
| $('#test_input').toggleDisabled(function(el, disabled){ |
| <?php | |
| class MY_Form_validation extends CI_Form_validation { | |
| public function set_message($lang, $val = '', $name = FALSE) | |
| { | |
| if($name !== FALSE){ | |
| $lang = $name.'.'.$lang; | |
| } |