Skip to content

Instantly share code, notes, and snippets.

// pulled from example.js
var directive = {
'li': {
'child <- children': {
'a': 'child.name',
'a@onclick':'alert(\'#{child.name}\');',
'div.children': function(ctxt){
return ctxt.child.item.children ? rfn(ctxt.child.item):'';
}
@quickredfox
quickredfox / Run VirtualboxVM without GUI
Created October 27, 2010 17:38
Run VirtualboxVM without GUI
# Get a list of available VMs:
VBoxManage list vms
# Start one of the VMs w/o starting a gui
VboxHeadless -s VMname &
# Run your web server inside a headless VM. Or an SSH server, etc.
/*
Innershiv from J.D. Bartlett
*/
window.innerShiv = (function() {
var d, r;
return function(h, u) {
/* Bien sur, cet exemple utilise jQuery... */
$(function() {
$('article').each(function() {
var $a = $(this),
$link = $('<a>').attr(
{
href: $a.attr('cite'),
text: $a.attr('title')
}, true
<article title="Le titre de mon article machin"
cite="http://example.com/url/to/article.html"
pubdate="2010-06-08T00:00:00Z">
<p>
le contenu de l'article et un peu de lorem ipsum et
<a href="#">un lien pour voir</a> pis kin, un <b>gras</b>!
</p>
</article>
body{
line-height:1.5em;
font-size:16px;
font-family:sans-serif;
}
article{
font-size:1em;
display:block;
width:30em;
padding:0.5em 0.75em;
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<meta name="description" content="description">
<title>Page Title</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
/*
"unsafe" JSON converters, allows one to also include functions
(does nto support native functions but an example workaround is given)
*/
JSON.unsafeStringify = function(obj){
if(typeof obj == 'object'){
if(obj instanceof Array) for(var i=0;i<obj.length;i++) obj[i] = JSON.unsafeStringify(obj[i]);
/*
This method plays on heideggerian theories.
It makes a method of Das Man -- or one that is unready-to-hand --
available ready-to-hand on a specified Dasein.
*/
var changeBeing = function(method,dasein){
return function readyToHand(){
/// THIS IS BROKEN, NEW VERSION TO COME... watch for it in my repos.
/* PraizedActionFacade.js 0.1 - "Facade Pattern" to simplify Praizd API actions for tempalte building
*
* Author: Francois Lafortune
* Copyright (c) 2010 PraizedMedia Inc.
*
* REQUIRES jsonPath() http://goessner.net/articles/JsonPath/
* I felt I should stress this: jsonPath does most of what's magic here and save a lot of lines of code
* in doing so...