Skip to content

Instantly share code, notes, and snippets.

View kouphax's full-sized avatar

James Hughes kouphax

View GitHub Profile
var coffeescriptCompiler = new CoffeeScriptCompiler(new ScriptReader(), new TempScriptWriter());
string s = coffeescriptCompiler.EvaluateScript(@"# Objects:
math =
root: Math.sqrt, square: square
cube: (x) -> x * square x");
Console.WriteLine(s);
Console.ReadLine();
public static void Main(string[] args)
{
Model.PlacementList allPlacements = Model.PlacementList.GetAll();
foreach (Model.Placement p in allPlacements)
{
if (p.CanBeTacitRenewed())
{
Model.GripTPrincipal principal = GripTPrincipal.ForUserId(p.PlacementAST.GetPrimaryContact());
p.PerformTacitRenewal();
function loadCss(url) {
var link = document.createElement("link");
link.type = "text/css";
link.rel = "stylesheet";
link.href = url;
document.getElementsByTagName("head")[0].appendChild(link);
}
<script type="text/javascript">
if(!Modernizr.borderradius){
require(["scripts/jquery-corners.js"], function(){
$(".borderradius").roundedcorners();
});
}
</script>
<script type="text/javascript">
if(!Modernizr.borderradius){
$(".borderradius").roundedcorners();
}
</script>
$("#somelement").bind("click", function(){
// this element was clicked
});
$("#somelement").bind("outsideclick", function(){
// some other element was clicked
});
$("#somelement").bind("click", function(){
if($("#dialog").is(":visible")){
$("#dialog").hide();
}
// perform function
});
<h1>ToDo List</h1>
<form id="new-task-form" action="\">
<p>
<label for="task">Task:</label>
<input type="text" id="task" name="task"/>
</p>
<p>
<label for="note">Note:</label>
<textarea id="note" name="note" rows="5" cols="30"></textarea>
</p>
var model = {}, // empty model object
list = $("#todo-list"),
form = $('#new-task-form'),
addBtn = $("#add"),
saveBtn = $("#save");
// link ui to model
form.link(model);
// handle onclick