This file contains 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
Example = Ember.Application.create({ | |
name: "Example Application", | |
logo: "http://sympodial.com/images/logo.png", | |
searchString: "%23EmberJS", | |
ready: function() { | |
Example.populate.getTweets(); | |
setInterval(function() { | |
Example.populate.getTweets(); | |
}, 2000); | |
}.observes("name") |
This file contains 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
Example.ChangeQuery = Ember.TextField.extend({ | |
change: function() { | |
var value = this.get('value'); | |
Example.set("searchString", value); | |
Example.populate.getTweets(); | |
} | |
}); |
This file contains 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
getTweets: function() { | |
var self = this; | |
var searchString = Example.get("searchString"); | |
var url = "http://search.twitter.com/search.json?callback=?&q=" + searchString; | |
$.getJSON(url, function(data) { | |
for (var i = 0; i < data.results.length; i++) { | |
self.addItem(Example.Item.create(data.results[i])); | |
}; | |
}) | |
} |
This file contains 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
<!doctype html> | |
<head> | |
<title>Ember test</title> | |
<script type="text/javascript" src="../lib/jquery.min.js"></script> | |
<script type="text/javascript" src="../lib/ember.min.js"></script> | |
</head> | |
<body> | |
<script type="text/x-handlebars"> | |
<img {{bindAttr src="Example.logo"}} alt="Logo"><br /> | |
<h1>{{ Example.name }}</h1> |
This file contains 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
if (Meteor.is_client) { | |
Template.hello.greeting = function () { | |
return "Welcome to meteor-intro."; | |
}; | |
Template.hello.events = { | |
'click input' : function () { | |
// template data, if any, is available in 'this' | |
if (typeof console !== 'undefined') | |
console.log("You pressed the button"); |
This file contains 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
<head> | |
<title>meteor-intro</title> | |
</head> | |
<body> | |
{{> hello}} | |
</body> | |
<template name="hello"> | |
<div class="hello"> |
This file contains 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
Follow(models.Model): | |
user = models.ForeignKey(User) | |
content_type = models.ForeignKey(ContentType) | |
object_id = models.PositiveIntegerField() | |
content_object = generic.GenericForeignKey('content_type', 'object_id') | |
created = models.DateTimeField() | |
description = models.CharField(max_length=255, null=True, blank=True) | |
def __unicode__(self): | |
return "%s: %s" % (self.user, self.description) |
This file contains 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
<img src="boat.gif" alt="Big Boat" /> | |
`1234567890-=[]\;',././.,';\][=-0987654321`~!@#$%^&*()_+{}|:"<>? | |
☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼»░▓│┤ |
This file contains 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
<!DOCTYPE html> | |
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]--> | |
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]--> | |
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]--> | |
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]--> | |
<head> | |
<title>{% block title %}{{ blog.name }}{% endblock %}</title> | |
<link rel="icon" href="/static/img/favicon.ico" /> | |
<meta name="description" content="Sympodial is the home of Barry Melton, an Annapolis-based web developer." /> | |
<meta name="keywords" content="Annapolis, Baltimore, DC, Web, Developer, HTML, CSS, Python, AJAX, Javascript" /> |
This file contains 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
{% extends "base.html" %} | |
{% block site_name %}{{ blog.name }}{% endblock %} | |
{% block main %} | |
{% for entry in entries %} | |
<div class="entry"> | |
<h1><a href="{{ entry.get_absolute_url() }}">{{ entry.title }}</a></h1> | |
<p class="date">{{ entry.pretty_date }}</p> | |
<div class="entry_content"> |