Skip to content

Instantly share code, notes, and snippets.

View jbandura's full-sized avatar

Jacek Bandura jbandura

View GitHub Profile
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
});
"==========================================
" MY VIMRC
"==========================================
"------------------------------
" § SET's
"------------------------------
set nocompatible " Disable vi-compatibility
"set t_Co=256
@jbandura
jbandura / controllers.application.js
Last active June 12, 2018 11:41
model contains test
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
johnIncluded: Ember.computed('models.[]', 'johnModel', function() {
return this.get('models').contains(this.get('johnModel'));
}),
init() {
@jbandura
jbandura / controllers.application.js
Created October 19, 2018 09:02
changing options
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
options: [
{ groupName: 'Group 1', options: Ember.A(['option 1', 'option 2']), },
{ groupName: 'Group 2', options: Ember.A(['option 5', 'option 3']), },
].map(i => Ember.Object.create(i)),
@jbandura
jbandura / strategia.java
Created January 23, 2019 16:03
Strategia
public interface IDatabaseStrategy {
void inicjujPolaczenie();
void zapiszDoBazyDanych(int dane);
void zamknijPolaczenie();
}
public class MysqlStrategy implements IDatabaseStrategy {
@Override
public void inicjujPolaczenie() {
System.out.println("Inicjuje MySQL");
import Ember from 'ember';
import lookupValidator from 'ember-changeset-validations';
import Changeset from 'ember-changeset';
import { validatePresence, validateFormat } from 'ember-changeset-validations/validators';
const validations = {
companyName: [validatePresence(true)],
email: [validatePresence(true), validateFormat({ type: 'email' })],
};
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
prop1: Ember.computed('appName', function() {
return this.get('appName') + '!';
}),
prop2: Ember.computed('appName', {
import Controller from '@ember/controller';
import { tracker } from '@glimmer/tracking';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
@tracked elements = [];
@action addElement() {
this.elements.pushObject('ele1');
}
""==========================================
" MY VIMRC
"==========================================
"------------------------------
" § SET's
"------------------------------
set nocompatible " Disable vi-compatibility
"set t_Co=256