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: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: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'));
},
POST /upload HTTP/1.1
Host: localhost:8991
Connection: keep-alive
Content-Length: 4914
Accept: application/json, text/plain, */*
Origin: https://create.arduino.cc
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Content-Type: application/json;charset=UTF-8
Referer: https://create.arduino.cc/editor/joachimhs/92bdba23-c0da-4097-b133-94a3d72eb87a
Accept-Encoding: gzip, deflate, br
App.Router.map(function() {
this.resource('index', {path: '/'}, function() {
this.resource('people', { path: '/people' }, function() {
this.route('active');
this.route('completed');
});
this.resource('places', {path: '/places'}, function() {});
this.resource('things', {path: '/things'}, function() {});
});
});
@joachimhs
joachimhs / gist:8466570
Created January 17, 2014 00:59
Precompiled Ember templates
Ember.TEMPLATES["application"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {
this.compilerInfo = [4,'>= 1.0.0'];
helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};
var buffer = '', stack1, helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
data.buffer.push(escapeExpression((helper = helpers.render || (depth0 && depth0.render),options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data},helper ? helper.call(depth0, "header", options) : helperMissing.call(depth0, "render", "header", options))));
data.buffer.push("\n<div id=\"mainArea\">\n ");
stack1 = helpers._triageMustache.call(depth0, "outlet", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});
if(stack1 || stack1 === 0) { data.buffer.push(stack1); }
{
"user": {
"id": "dfd07d91-5244-482b-ab0b-1fd9fa92ab30",
"userId": "joachim@haagen.name",
"fullName": "Joachim Haagen Skeie",
"company": "Haagen Software AS",
"phone": "41415805",
"dietaryRequirements": "",
"countryOfResidence": "Norway",
"yearOfBirth": "1981",
Emberfest.ProfileRoute = Ember.Route.extend({
model: function() {
var uuidToken = this.controllerFor('user').readCookie('uuidToken');
console.log('ProfileRoute uuidToken: ' + uuidToken);
return this.store.find('user', uuidToken);
}
});
[mc5@mc5 kvm_imgs]$ sudo qemu-img create -f qcow2 rethinkdb.qcow 20G
[mc5@mc5 kvm_imgs]$ sudo qemu-img info rethinkdb.qcow
image: rethinkdb.qcow
file format: qcow2
virtual size: 20G (21474836480 bytes)
disk size: 136K
cluster_size: 65536
@joachimhs
joachimhs / gist:6416623
Created September 2, 2013 19:44
ED Beta 1 sample
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="author" content="Joachim Haagen Skeie">
<title>Ember Data</title>
@joachimhs
joachimhs / gist:5973284
Created July 11, 2013 07:26
Strange ===
Embriak.BucketLiView = Ember.View.extend({
tagName: 'li',
template: Ember.Handlebars.compile('{{#linkTo keys this}}{{id}}{{/linkTo}}'),
classNameBinding: 'active',
active: function() {
console.log("this.get('content.id') === this.get('controller.controllers.keys.content.id'): '" + this.get('content.id') + "' ::: '" + this.get('controller.controllers.keys.content.id') + "'");
console.log("this.get('content.id') === this.get('controller.controllers.keys.content.id'): " + this.get('content.id') === this.get('controller.controllers.keys.content.id'));
return this.get('content.id') === this.get('controller.controllers.keys.content.id');