This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MvcApplication : System.Web.HttpApplication | |
{ | |
public static void RegisterRoutes(RouteCollection routes) | |
{ | |
// ... | |
routes.MapRoute( | |
"less", | |
"less.mvc/{action}/{name}.css", | |
new { controller = "Less", action = "Show" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Mvc; | |
using System.IO; | |
namespace MvcApplication1.Controllers { | |
public class LessController : Controller { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Show.aspx.cs" Inherits="MvcApplication1.Views.Home.Show" %> | |
<%= ViewData["Css"] %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Get.aspx.cs" Inherits="MvcApplication1.Views.Home.Get" %> | |
<html> | |
<head> | |
<link type="text/css" rel="Stylesheet" href="/less.mvc/Show/<%= ViewData["Name"] %>.css" | |
</head> | |
<body> | |
<h1 id="header" name="header"> This is the less source:</h1> | |
<pre> | |
<%= ViewData["Less"] %> | |
</pre> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* LESS */ | |
@brand_color: #4D926F; | |
@other_color: rgb(166,255,122); | |
.common-rules{ | |
border:1px solid silver; | |
} | |
.font-rules{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
public class MyClass | |
{ | |
public static void Swap<T> (T a , T b){ | |
T x = a; | |
a = b; | |
b = x; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function.implement('Invoke', | |
function(args){ | |
var tmp = Class.instantiate(this); | |
var init = this.prototype.initialize; | |
if(init){ | |
init.apply(tmp,$splat(args)); | |
} | |
return tmp; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var IOC = new Class({ | |
initialize:function(){ | |
this.container = {}; | |
}, | |
register:function(id, component, options){ | |
if($type(id) != 'string')throw new Error("No id to register"); | |
if(!$chk(component))throw new Error("No component to register"); | |
var o = options || {type:'singleton'}; | |
this.container[id] = {type:o.type, component:component}; | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Sarissa glitch with mootools</title> | |
<script type="text/javascript" src="sarissa.js"></script> | |
<script type="text/javascript" src="sarissa_ieemu_xpath.js"></script> | |
<script type="text/javascript" src="mootools-1.2.4-core-nc.js"></script> | |
<script type="text/javascript"> | |
addEvent('domready',function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Mootools $type and ActiveXObject</title> | |
<script type="text/javascript" src="mootools-1.2.4-core-nc.js"></script> | |
<script type="text/javascript"> | |
addEvent('domready',function(){ | |
var doc = new ActiveXObject("Msxml2.DOMDocument.4.0"); | |
var source = '<root><burp decibel="too much" direction="front of you" save="none"></burp></root>'; | |
doc.async = false; | |
doc.loadXML(source); |
OlderNewer