Skip to content

Instantly share code, notes, and snippets.

View tridungpham's full-sized avatar

Pham Tri Dung tridungpham

View GitHub Profile
var asyncModule = function(name) {
return {
controller: function() {
m.startComputation()
require([name], function(module) {
this.controller = new module.controller()
this.view = module.view
m.endComputation()
var asyncModule = function(name) {
return {
controller: function() {
m.request({
method: "GET",
url: name + ".js",
deserialize: function(data) {
return new Function("var module = {};" + data + ";return module").call().exports
}
})
class ASampleClass
{
public static function test()
{
return 'yo';
}
}
echo (new ASampleClass())->test();
<?php
/**
* Asset dependencies manager
* @author: dphamtri
* @date 20140124
*/
class AssetManager
{
static $instance = null;

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
jQuery(document).ready(function ($) {
var divs=$('.sbSubLitsIt .listIt').hide();
var divs2=$('.sbListIt .sbSubList').hide();
jQuery('.sbSubLitsIt').each(function(){
if(jQuery(this).find('.listIt').length){
jQuery(this).find('.clShowCapNone').addClass('clShowCap');
}
});
jQuery('.sbListIt').each(function(){
if(jQuery(this).find('.sbSubList').length){
@tridungpham
tridungpham / realphim-api.md
Created July 21, 2014 06:23
New Markdown document

##Register new user URI : http://realphim.com/api/user/register ###Input

  • username : required, length [3-32], alpha numeric
  • password : required, length [3-32]
  • email : required, valid email
  • first_name : required, length [1-100]
  • last_name : required, length [1-100]

Output

@tridungpham
tridungpham / test.xml
Created December 5, 2013 04:18
Test layout file
<richcart_product_view>
<label>Catalog Product View (Any)</label>
<!-- Mage_Catalog -->
<remove name="right"/>
<remove name="left"/>
<!-- <reference name="root">
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
</reference> -->
<reference name="head">
<action method="addJs"><script>varien/product.js</script></action>
@tridungpham
tridungpham / new_gist_file.sql
Created December 4, 2013 10:28
Create new admin user in Magento with password "admin"
INSERT INTO admin_user SELECT
NULL `user_id`,
"Dung" `firstname`,
"Pham" `lastname`,
"[email protected]" `email`,
"dungpt.sutunam" `username`,
"9684dfd577831f73890e88fe18ca9072:Hs" `password`,
NOW() `created`,
NULL `modified`,
NULL `logdate`,
@color: #666;
@type: 'bold';
body{
background-color: @color;
font-weight: @type;
}