Skip to content

Instantly share code, notes, and snippets.

View balinterdi's full-sized avatar
👌
Enjoying life, including work.

Balint Erdi balinterdi

👌
Enjoying life, including work.
View GitHub Profile
@balinterdi
balinterdi / route.js
Created June 20, 2016 07:21
Eager-fetch belongsTo relationships – does not work
model(params) {
return this.store.findRecord('person', params.person_id)
.then((person) => {
return {
friendships: person.get('friendships', { include: 'friender,friended' }),
person
}});
},
@balinterdi
balinterdi / controllers.application.js
Created April 8, 2016 12:32
RARWE: First template
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@balinterdi
balinterdi / ga-events.js
Created March 4, 2016 20:40
Prevent GA to report too high of a bounce rate for your "one page at one visit" site (a landing page or a blog)
$.domReady(function(){
// Fire an event so that GA doesn't count it as a "bounce"
// http://blog.popcornmetrics.com/why-your-google-analytics-bounce-rate-is-wrong-and-how-to-fix-it/
function readPage() {
ga('send', {
'hitType': 'event',
'eventCategory': 'engagement',
'eventAction': 'read'
});
}
@balinterdi
balinterdi / app.css
Last active February 3, 2016 08:31
Binding style attributes warning in Ember
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
.bordered {
border: 1px solid blue;
height: 100px;
}
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
// value: 'Over The Hills'
value: null,
});
@balinterdi
balinterdi / d3-heatmap.html
Created December 22, 2015 14:56 — forked from nfisher/d3-heatmap.html
Simple D3.js SVG heatmap
<!doctype HTML>
<title>D3 Test</title>
<script src="d3.v3.min.js" charset="utf-8"></script>
<style type="text/css">
body {
margin:0 auto;
position:relative;
width:958px;
}
.chart rect {
@balinterdi
balinterdi / environment.js
Created October 8, 2015 19:23
CSP for Ember apps
/* jshint node: true */
const contentSecurityPolicy = {
'default-src': "'none'",
'script-src': "'self'",
'font-src': "'self'",
'connect-src': "'self' localhost:*",
'img-src': "'self'",
'style-src': "'self' 'unsafe-inline'",
'media-src': "'self'"
};
@balinterdi
balinterdi / abstract.txt
Last active September 14, 2015 13:48
Talk description for Complex Component Design in Ember.js
Designing component hierarchies in Ember had historically somewhat
tortuous but with the arrival of block parameters (1.10) and closure
actions (1.12), the difficulties have been vastly mitigated. I take a
slightly complex example, that of an autocomplete input, and show how to
go about implementing a nested component hierarchy in Ember and how the
aforementioned features and others help us pull it off.
@balinterdi
balinterdi / README
Created January 14, 2015 13:26
Test my fixes for broccoli-asset-rewrite
$ git clone https://github.com/balinterdi/broccoli-asset-rewrite.git
$ git checkout fix-broken-composite-paths-on-win remotes/origin/fix-broken-composite-paths-on-win
$ npm i
$ npm test
@balinterdi
balinterdi / keybase.md
Created December 25, 2014 20:45
keybase.md

Keybase proof

I hereby claim:

  • I am balinterdi on github.
  • I am balint (https://keybase.io/balint) on keybase.
  • I have a public key whose fingerprint is 0C1B 0498 F427 03DB 1960 C034 66CC 2C76 BF64 5B44

To claim this, I am signing this object: