Skip to content

Instantly share code, notes, and snippets.

View PoslinskiNet's full-sized avatar
🐹
#TomsterOnTour

Dawid Pośliński PoslinskiNet

🐹
#TomsterOnTour
View GitHub Profile
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
add() {
const { title, calories } = this;
this.db.recipes.add({ title, calories: parseInt(calories) }).then(() => {
this.db.table("recipes")
.orderBy("calories")
import Ember from 'ember';
import { computed } from '@ember/object';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
label: '',
hashCode(str) {
let hash = 0;
for (let i = 0; i < str.length; i++) {
import Ember from 'ember';
import { computed } from '@ember/object';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
test: computed('{bla,la}', function() {
return `${this.bla},${this.la}`;
}),
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
});
@PoslinskiNet
PoslinskiNet / components.github-user-search.js
Last active October 21, 2018 14:37
Ember Concurrency Demo
import Ember from 'ember';
import { task, timeout } from 'ember-concurrency';
import { isBlank } from '@ember/utils';
const DEBOUNCE_MS = 250;
const API_URL = 'https://api.github.com/search/users?q=';
export default Ember.Component.extend({
searchUsers: task(function * (term) {
if (isBlank(term)) { return []; }
@PoslinskiNet
PoslinskiNet / components.navigation-bar.js
Created September 23, 2018 15:48
#30DaysOfEmber - Computed Properties Demo
// app/components/navigation-bar/component.js
import Component from '@ember/component';
import { computed } from '@ember/object';
export default Component.extend({
counter: 0,
clickCounterDecorated: computed('counter', function() {
return `Counter: ${this.counter}`;
}),
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
value: `<div>
<p><span style="font-weight: bold;">Type: </span> exploration, adventure</p>
<br>
<p><span style="font-weight: bold;">Audio: </span> English</p>
</div>`,
pellOptions: {
@PoslinskiNet
PoslinskiNet / Broccoli analyzer.MD
Last active June 29, 2018 05:56
Analyze your ember app vendor file
  • npm install -g broccoli-concat-analyser
  • CONCAT_STATS=true ember s -e production
  • kill the server
  • broccoli-concat-analyser ./concat-stats-for

IMAGE