Skip to content

Instantly share code, notes, and snippets.

Mirko Akov mupkoo

Block or report user

Report or block mupkoo

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
@mupkoo
mupkoo / jsconfig.json
Last active Aug 13, 2019
jsconfig.json for Ember CLI project
View jsconfig.json
{
"compilerOptions": {
"target": "es2018",
"experimentalDecorators": true,
"baseUrl": ".",
"paths": {
"{put-your-app-name-here}/tests/*": ["./tests/*"],
"{put-your-app-name-here}/mirage/*": ["./mirage/*"],
"{put-your-app-name-here}/*": ["./app/*"]
}
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@mupkoo
mupkoo / 01-transition-to.js
Last active Dec 4, 2018
transiton-to helper
View 01-transition-to.js
import Helper from '@ember/component/helper';
import { inject as service } from '@ember/service';
export default Helper.extend({
router: service(),
compute(params) {
return (maybeEvent) => {
if (maybeEvent !== undefined && typeof maybeEvent.preventDefault === 'function') {
maybeEvent.preventDefault();
@mupkoo
mupkoo / components.my-link-to.js
Last active Nov 5, 2018
Extend LinkComponent
View components.my-link-to.js
@mupkoo
mupkoo / attachments-input.js
Last active Oct 11, 2018
Attachments input
View attachments-input.js
import Component from '@ember/component';
import { computed } from '@ember/object';
import { or } from '@ember/object/computed';
import { inject as service } from '@ember/service';
import { task } from 'ember-concurrency';
import { Promise, all } from 'rsvp';
import S3Uploader from 'ember-uploader/uploaders/s3';
export default Component.extend({
notify: service('satellite-notify'),
@mupkoo
mupkoo / application-adapter.js
Created Aug 27, 2018
Cascade delete has many relations Ember Data
View application-adapter.js
import DS from 'ember-data';
export default DS.JSONAPIAdapter.extend({
deleteRecord(store, type, snapshot) {
let recordsForUnloading = [];
snapshot.eachRelationship((name, descriptor) => {
let { options, kind, key } = descriptor;
if (options.onDelete === 'unload' && kind === 'hasMany') {
@mupkoo
mupkoo / sanitize.rb
Created Feb 5, 2018
Simple content configuration for sanitize gem
View sanitize.rb
# frozen_string_literal: true
require 'uri'
ALLOWED_IFRAME_TLDS = %w[
facebook.com
google.com
twitter.com
vimeo.com
youtube.com
].freeze
View share_link_helper.rb
View components.my-heart.js
import Ember from 'ember';
export default Ember.Component.extend({
on: false,
click(e) {
this.toggleProperty('on');
return false;
}
});
You can’t perform that action at this time.