#See names and values of form
var str = {};
$("form").serializeArray().forEach(function(item){
str[item.name] = item.value;
});
console.log(str);
#See names and values of form
var str = {};
$("form").serializeArray().forEach(function(item){
str[item.name] = item.value;
});
console.log(str);
#Search on Json data
$('#search').keyup(function(){
var searchField = $(this).val();
var myExp = new RegExp( searchField, "i" );
$.getJSON('data.json', function(data){
var output = '<ul class="searchresults">';
$.each(data, function(key, val){
Create global gitignore
$ git config --global core.excludesfile ~/.gitignore
$ echo .DS_Store >> ~/.gitignore
#Controling Events with DelegateEvents
In Backbone Views
events: {
'click .gallery-right-arrow-wrap' : 'loadMore',
'click .gallery-left-arrow-wrap' : 'loadLess',
'click .about-video-item-wrap' : 'callVideo'
},
eventsOff: function(unbind) {
this.delegateEvents(_(this.events).omit(unbind));
#Apache on Mac OS
update DocumentRoot
$ sudo vim /etc/apache2/httpd.conf
Apache restart to update changes
$ sudo apachectl restart
#Mysql Commands
###Accessing the mysql database
$ mysql -u root -p
###Creating and using the database >on console, mysql>
#Rails Commands
##Creating new Project
New Project Sample
$ rails new project_name
#Get starting with Ruby On Rails
###Setup
###Ruby version managing
#'cat' with syntax highlighting
by Osvaldo Zonetti https://coderwall.com/p/lzgryq/cat-with-syntax-highlighting
Install pygmentize with easy_install or pip:
$ sudo apt-get install python-setuptools
$ sudo easy_install pygments