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
App = Ember.Application.create(); | |
App.Router.reopen({ | |
location: 'history', | |
rootURL: '/blog/' | |
}); | |
App.Router.map(function() { | |
this.resource('posts', function () { | |
this.route('archive'); |
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
/* Put your CSS here */ | |
html, body { margin: 20px; } | |
h1 { font-size: 1.6em; padding-bottom: 10px; } | |
h2 { font-size: 1.4em; } | |
dl { padding: 15px; font-size: 1.4em; color: blue; } |
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
html, body { margin: 20px; } | |
h1 { font-size: 1.6em; padding-bottom: 10px; } | |
h2 { font-size: 1.4em; } | |
dl { padding: 15px; font-size: 1.4em; color: blue; } |
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
<script type="text/javascript"> | |
if (navigator.userAgent.match(/Gecko/) !== null && navigator.userAgent.match(/Firefox/) !== null) { | |
window.location = 'http://browsehappy.com'; // put a link here; | |
} | |
</script> |
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> | |
<html> | |
<head> | |
<title>Posts - Mocking AJAX with ember-testing-httpRespond</title> | |
<meta name="description" content="Using All Helpers" /> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/2.1.0/normalize.css"> | |
<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.14.0.css"> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script> | |
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.3.0.js"></script> |
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
get = Ember.get | |
App.BaseModel = DS.Model.extend | |
autoSave: (-> | |
if get(@, 'isDraft') and !(get @, 'isNew') and isReallyDirty @ | |
Ember.run.debounce @, '_doAutoSave', 12000 | |
).observes 'isDirty' | |
_doAutoSave: -> |
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
# Strange that model can be dirty with no changed attrs | |
isReallyDirty = (model) -> | |
hasChangingAttr = false | |
attrs = [] | |
model.eachAttribute (name)-> attrs.push name | |
for own key, value of model.changedAttributes() | |
if attrs.contains key | |
hasChangingAttr = true | |
break | |
hasChangingAttr |
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> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>CSS Universal Selector - Test performance of Lobotomized Owl Selector</title> | |
<!-- See http://alistapart.com/article/axiomatic-css-and-lobotomized-owls --> | |
<!-- Perf test based on https://github.com/benfrain/css-performance-tests/blob/master/CSS%20Selectors/15.html --> | |
<meta name="description" content="Rudimentary Test for Lobotomized Owl Selector Speed"> | |
<meta name="viewport" content="width=device-width"> | |
<style> |
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
/node_modules | |
npm-debug.log |
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
/* | |
Add `nouns` as http mocks and use in a local db, available via API in develoment | |
* Install the adapter `npm install rethinkdb_adapter --save-dev` | |
* Install RethinkDB, see https://github.com/pixelhandler/ember-slide-deck/blob/master/bin/install_rethinkdb.sh | |
* Start db `rethinkdb` | |
* Setup Db and Table, see https://github.com/pixelhandler/ember-slide-deck/blob/master/bin/setup_db.js | |
* Generate a mock `ember g http-mock nouns` and edit your mock to use the db, see code below for 'slides' | |
* Set your application adapter to use `namespace: 'api'` | |
* In our routes use Ember Data in your model hook |
OlderNewer