Skip to content

Instantly share code, notes, and snippets.

👌
Enjoying life, including work.

Balint Erdi balinterdi

👌
Enjoying life, including work.
Block or report user

Report or block balinterdi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAnMnNV3Wonaxa0BHY5gTelsUpet1qRfEhzJUGN04tD1gXXAZnF+iDBQcw7g7600MS0OsXbiquQYiyqEhnnLpUv4fMmN+aEoqh20+smU6iKbHN2RwXwb7NRQ6kzHyQD+QC+/6MJjOsdjCibLmljMwGUh1MKw+AQ248cooSJdpHKqs=
View ethers
0x1E65F71b024937b988fdba09814d60049e0Fc59d
@balinterdi
balinterdi / copy-text-to-clipboard.js
Created Jul 27, 2017
Copy some text to the clipboard using the brower's DOM API
View copy-text-to-clipboard.js
export default function copyTextToClipboard(text) {
let textArea = document.createElement("textarea");
textArea.value = text;
document.body.appendChild(textArea);
textArea.select();
try {
// Now that we've selected the anchor text, execute the copy command
let successful = document.execCommand('copy');
let message = successful ? 'successful' : 'unsuccessful';
@balinterdi
balinterdi / settings.json
Created May 26, 2017
My VSCode configuration
View settings.json
{
"window.zoomLevel": 1,
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/tmp": true,
"node_modules": true, // this excludes the folder
// only from the root of
// your workspace
"tmp": true,
@balinterdi
balinterdi / router.js
Created Apr 25, 2017
Log in in a modal (lightbox), without the page "underneath" disappearing
View router.js
Router.map(function() {
this.route('about-us', function() {
this.route('login', { path: '/' }); // or you can even have a different path if you don't mind the URL change
});
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@balinterdi
balinterdi / notes.md
Last active Feb 24, 2017
First-class support for JSON API features in Ember Data
View notes.md

As I'm preparing for my EmberConf presentation about "Loading data patterns with JSON API" I realized there are several areas (JSON API features) where Ember Data could go further and provide a more seamless integration between Ember's data layer and the (JSON) API server.

One example of where this integration is already done is the include parameter that can be passed to store.findAll and store.findRecord.

On the other hand, here are a few ones where I think ED could provide a tighter integration:

\1. Querying relationships

View components.my-component-1.js
import Ember from 'ember';
export default Ember.Component.extend({
myFirstAction: '',
actions: {
myComponentAction() {
this.sendAction('myFirstAction');
}
}
});
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
myColor: 'red',
});
View controllers.application.js
import Ember from 'ember';
function loadAndSave(loadingProperty, operation) {
this.set(loadingProperty, true);
return operation.finally(() => {
this.set(loadingProperty, false);
});
}
export default Ember.Controller.extend({
You can’t perform that action at this time.