Skip to content

Instantly share code, notes, and snippets.

<HTML>
<HEAD>
<TITLE>Το πρώτο μου παράδειγμα CSS!</TITLE>
<STYLE TYPE="text/css">
BODY {
background-color: blue;
color: red;
}
H1 {
text-align: right;
<HTML>
<HEAD>
<TITLE>Το πρώτο μου παράδειγμα CSS!</TITLE>
<STYLE TYPE="text/css">
BODY {
background-color: blue;
color: red;
}
H1 {
text-align: right;
Object.defineProperty(person, 'name', { get: get_full_name
, set: set_full_name
, configurable: true
, enumerable: true });
person.greet = function (person) {
return this.name + ': hello there, ' + person + '.' ;
}
function set_full_name(new_name) {
var names ;
names = new_name.trim().split(/\s+/) ;
this.first_name = names[⁣"0"] || "" ;
this.last_name = names["1"] || "" ;
}
var book = Object.create(null);
book["title"]="euclides 1";
book["author"]="euclid" ;
book["pages"]=140 ;
document.write("book's title is:" + book["title"]);
@chomwitt
chomwitt / gist:5045916
Created February 27, 2013 07:21
object creation problem
var person = Object.create(null);
// Here we are reusing the previous gettersetter functions
Object.defineProperty(person, 'name', { get: get_full_name , set: set_full_name , configurable: true, enumerable: true });
// And adding the `greet' function
person.greet = function (person) {
return this.name + ': Why, hello there, ' + person + '.' ;
}
@chomwitt
chomwitt / gist:4761198
Created February 12, 2013 09:34
testing a simple handlebar expression in an ember template in emberstarterkit
index.html----------------------
<script type="text/x-handlebars">
{{#view App.MyView}}
<h1>Hello world!</h1>
{{/view}}
<p>{{firstName}},{{lastName}}</p>
</script>
app.js --------------------------------
ss.client.define('webturtle', {
view: 'webturtle.html',
css: ['libs/reset.css', 'mainwt.css'],
code: ['libs/jquery.min.js', 'webturtle'],
tmpl: '*'
});
cliet/view/webturtle.html--------------
<!DOCTYPE HTML>
<html>
<head>
<title>WebTurtle/Parser tests</title>
<meta charset="utf-8">
<script language="javascript" SRC="./js/peg-0.7.0.js"></script>
<script language="peg" id="grammar">
start
= additive
<!DOCTYPE HTML>
<html>
<head>
<title>WebTurtle/Parser tests</title>
<meta charset="utf-8">
<SCRIPT language="JavaScript" SRC="js/peg-0.7.0.js"></SCRIPT>
</head>
<body>
<script>