Skip to content

Instantly share code, notes, and snippets.

View joachimhs's full-sized avatar

Joachim Haagen Skeie joachimhs

View GitHub Profile
@joachimhs
joachimhs / gist:3005963
Created June 27, 2012 18:47
Ember Data mapping
If this is the Data Structure, how can Ember Data map this structure to real DS.Model objects ?
[
{
"id": 123,
"name": "measurement point ...",
"reference": {
"measurement": {
"id": 889
}
@joachimhs
joachimhs / gist:3529609
Created August 30, 2012 14:27
Ember.js rerender on window resize issue
init: function() {
var view = this;
var resizeHandler = function() {
view.rerender();
};
this.set('resizeHandler', resizeHandler);
$(window).bind('resize', this.get('resizeHandler'));
},
@joachimhs
joachimhs / gist:3604578
Created September 2, 2012 21:10
Transitionto
HS.router = Ember.Router.create({
enableLogging: true,
//location: 'history',
root: Ember.Route.extend({
enter: function() {
//HS.router.get('blogPostsListController').set('content', HS.store.findAll(HS.BlogPost));
console.log('enter root state');
HS.store.findAll(HS.PageModel);
},
@joachimhs
joachimhs / gist:3625373
Created September 4, 2012 19:27
CollectD install issue OS X 10.8
This file has been truncated, but you can view the full file.
joahaa:~ joahaa$ HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install collectd
==> Downloading http://collectd.org/files/collectd-5.1.0.tar.bz2
Already downloaded: /Library/Caches/Homebrew/collectd-5.1.0.tar.bz2
/usr/bin/tar xf /Library/Caches/Homebrew/collectd-5.1.0.tar.bz2
==> ./configure -C --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/collectd/5.1.0 --localstatedir=/usr/local/var --with-python=/usr/bin
./configure -C --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/collectd/5.1.0 --localstatedir=/usr/local/var --with-python=/usr/bin
configure: creating cache config.cache
checking build system type... x86_64-apple-darwin12.1.0
checking host system type... x86_64-apple-darwin12.1.0
checking for gcc... cc
@joachimhs
joachimhs / gist:3652535
Created September 6, 2012 07:21
libltdl config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by libltdl configure 2.2.6b, which was
generated by GNU Autoconf 2.65. Invocation command line was
$ ./configure --disable-option-checking --prefix=/usr/local/Cellar/collectd/5.1.0 --disable-debug --disable-dependency-tracking --localstatedir=/usr/local/var --with-python=/usr/bin CC=cc PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/Library/Homebrew/pkgconfig --enable-ltdl-convenience --cache-file=../config.cache --srcdir=.
## --------- ##
## Platform. ##
@joachimhs
joachimhs / gist:4233507
Created December 7, 2012 14:16
Sideloading Ember Data
{
"chapters": [
{
"title": "Ember.js - Powering Your Next Ambitious Web Application",
"index": 1,
"id": "ch01",
"abstract": "ch01_abs",
"sections": [
"ch01_4",
"ch01_40"
@joachimhs
joachimhs / gpio.jsons
Created December 11, 2012 08:38
PinStatus
{
"pinstatus":
{
"id": "gpio",
"vdcOne": false,
"vdcTwo": false,
"sda0": false,
"dnc0": false,
"scl0": false,
"gnd": false,
//STORE
Jaspberry.store = DS.Store.create({
//adapter: Jaspberry.Adapter,
adapter: DS.RESTAdapter.create({
bulkCommit: false,
plurals: { pinstatus: 'pinstatuses'}
}),
revision: 10
});
EurekaJ.MainChartsRoute = Ember.Route.extend({
model: function() {
return EurekaJ.MainMenuModel.find();
},
setupController: function(controller, model) {
//controller.set('content', model); //Tried it with an without this, even with set('content', EurekaJ.MainMenuModel.find());
}
});
EurekaJ = Ember.Application.create();
EurekaJ.Router.map(function() {
this.route("login", {path: "/"});
this.resource("main", {path: "/main"}, function() {
this.route("dashboard");
this.route("charts");
this.route("chartGroups");
this.route("alerts");
this.route("administration");