Skip to content

Instantly share code, notes, and snippets.

View joachimhs's full-sized avatar

Joachim Haagen Skeie joachimhs

View GitHub Profile
@joachimhs
joachimhs / binding.js
Created January 11, 2012 13:48
bidning problem
For some reason I am unable to get the bindings to work as they are supposed to...
index.html:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
@joachimhs
joachimhs / gist:2260072
Created March 31, 2012 06:46
handlebars helper disqus
Handlebars.registerHelper('disqus', function(property) {
var value = '<script type="text/javascript" src="http://joachimhs.disqus.com/combination_widget.js?num_items=5&hide_mods=0&color=blue&default_tab=people&excerpt_length=200"></script><a href="http://disqus.com/">Powered by Disqus</a>';
console.log(value);
return new Handlebars.SafeString(value);
});
@joachimhs
joachimhs / Vertx.handler
Created May 14, 2012 16:41
Vert.X Handler
package org.eurekaj.manager.data;
import org.vertx.java.core.Handler;
import org.vertx.java.core.buffer.Buffer;
import org.vertx.java.core.http.HttpServerRequest;
public class HandleInstrumentationMenuRequest implements Handler<Buffer> {
private HttpServerRequest req;
public HandleInstrumentationMenuRequest(HttpServerRequest req) {
@joachimhs
joachimhs / primaryKeyMissing
Created May 23, 2012 08:21
No Primary Key
Model:
MyApp.Photo = DS.Model.extend({
primaryKey: 'id',
id: DS.attr('string'),
photoName: DS.attr('string'),
photoDescription: DS.attr('string'),
photoFullSizeURL: DS.attr('string'),
photoThumbnailURL: DS.attr('string')
});
@joachimhs
joachimhs / gist:2775283
Created May 23, 2012 13:40
No Properties from Ember Data
Problem: The JSON is received from the server, but only the "id" property have a value. The GUI only displays the String "2 1", an the {{photoName}} is ignored. Manually calling MyApp.PhotoController.get('content').objectAt(0).get('photoName') returns "undefined", whereas MyApp.PhotoController.get('content').objectAt(0).get('id') returns the correct ID.
Any Sugggestions ?
//My Model:
MyApp.Photo = DS.Model.extend({
id: DS.attr('number'),
photoName: DS.attr('string'),
photoDescription: DS.attr('string'),
photoFullSizeURL: DS.attr('string'),
@joachimhs
joachimhs / gist:2900484
Created June 9, 2012 10:38
Ember Router
HS.router = Ember.Router.create({
rootElement: '#emberArea',
start: Ember.ViewState.extend({
route: "/",
setupControllers: function(manager) {
if (window.console) console.log('setupControllers: /');
},
@joachimhs
joachimhs / gist:2950393
Created June 18, 2012 20:00
ArrayController
Controller:
HS.BlogPostsListController = Em.ArrayController.create({
content: [],
sortAscending: true,
sortProperties: ['postDate'],
...
});
Populated with:
@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: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. ##