Skip to content

Instantly share code, notes, and snippets.

View michaeldeol's full-sized avatar

Michael Deol michaeldeol

View GitHub Profile
@michaeldeol
michaeldeol / MagentoDB
Created May 7, 2013 06:09
How to create a Magento DB in Vagrant.
$ vagrant ssh
$ mysql -u root -p
mysql > CREATE DATABASE magento;
mysql > GRANT ALL ON magento.* to magento@localhost IDENTIFIED BY 'magento';
mysql > exit
Tracing dependencies for: ../common
Tracing dependencies for: ../page1
Tracing dependencies for: ../page2
Tracing dependencies for: jquery
js/lib/../common.js
----------------
define(function ( require ) {
var $ = require( 'jquery' ),
_ = require( 'underscore' ),
Backbone = require( 'backbone' ),
lib = require( './lib' ),
controller = require( './controller/c1' ),
model = require( './model/m1' );
//A fabricated API to show interaction of
//common and specific pieces.
Tracing dependencies for: ../common
Tracing dependencies for: ../page1
Tracing dependencies for: ../page2
js/lib/../common.js
----------------
js/lib/../common.js
js/lib/jquery.js
// View: NewWineView
window.WineNewView = Backbone.View.extend({
template: _.template( $('#tpl-wine-new').html() ),
events: {
'change input': 'wineChange',
'click .save': 'wineSave',
'click .cancel': 'wineCancel'
},
@michaeldeol
michaeldeol / assessment.md
Created May 11, 2012 16:17 — forked from rmurphey/assessment.md
assessment

What do you think the following code does?

function fn(msg, time) {
  setTimeout(function() {
    console.log(msg);
  }, time);
}

fn('it works', 1000);
@michaeldeol
michaeldeol / thumbnails.js
Created May 4, 2011 20:18 — forked from jiggliemon/thumbnails.js
This should contain the stand alone code for the tumbnails, and their related functionality
//
// The code in this file should:
// - build a thumbnail container
// - populate the container with thumbnails
// - when a thumbnail is clicked, the main image should be updated with the appropriate image
//
// This code should be optional, and initiate itself if included.
//
(function(){
var thumbContainer = document.createDocumentFragment();
@michaeldeol
michaeldeol / TextMate jQuery No Conflicts Snippet
Created June 4, 2010 03:57
Shorter version of the jQuery bundle of Document Ready (Safe) for TextMate (Snippet).
(function(\$) {
${0:// Stuff to do as soon as the DOM is ready. Use \$() w/o colliding with other libs;}
})(jQuery);
/*
Form Elements
-- Styled to look like native Safari on OS X.
-- Drop-down <select> menus are unaffected.
-- Buttons are unaffected. Native OS style.
*/
input,
button,
select,