Skip to content

Instantly share code, notes, and snippets.

@dre3s
dre3s / pkgs.utils.ccat.md
Last active January 12, 2016 18:03
pkgs.utils.ccat
@dre3s
dre3s / my.study.ruby.rails.starting.md
Last active January 12, 2016 18:01
my.study.ruby.rails.starting
@dre3s
dre3s / rails.utils.md
Last active January 12, 2016 13:44
rails.utils
@dre3s
dre3s / mysql.utils.md
Last active January 12, 2016 13:44
mysql.utils

#Mysql Commands

###Accessing the mysql database

$ mysql -u root -p

###Creating and using the database >on console, mysql>

@dre3s
dre3s / my.apache.htttpd.config.md
Last active January 12, 2016 18:00
my.apache.htttpd.config

#Apache on Mac OS

update DocumentRoot

$ sudo vim /etc/apache2/httpd.conf

Apache restart to update changes

$ sudo apachectl restart
@dre3s
dre3s / my.js.backbone.delegateEvents.md
Last active January 12, 2016 17:49
my.js.backbone.delegateEvents

#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));
@dre3s
dre3s / git.utils.gitignore.global.md
Last active January 12, 2016 18:09
git.utils.gitignore.global

Create global gitignore

$ git config --global core.excludesfile ~/.gitignore
$ echo .DS_Store >> ~/.gitignore
@dre3s
dre3s / my.js.search.json.md
Last active January 12, 2016 17:50
my.js.search.json

#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){                                                       
@dre3s
dre3s / my.js.form.serialize.array.md
Last active January 12, 2016 17:52
my.js.form.serialize.array

#See names and values of form

var str = {};
$("form").serializeArray().forEach(function(item){
    str[item.name] = item.value;
});
console.log(str);