Skip to content

Instantly share code, notes, and snippets.

🤓
Code it!

Alex Kanunnikov lifeart

🤓
Code it!
Block or report user

Report or block lifeart

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
@lifeart
lifeart / script.js
Created Feb 19, 2020
ember-animation route transitions
View script.js
import Component from "@glimmer/component";
import { action } from "@ember/object";
import opacity from "ember-animated/motions/opacity";
import Sprite from "ember-animated/-private/sprite";
interface TransitionContext {
duration: number;
insertedSprites: Sprite[];
removedSprites: Sprite[];
receivedSprites: Sprite[];
@lifeart
lifeart / component.js
Created Feb 6, 2020
Ember Cp Validations Octane
View component.js
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import Object from "@ember/object";
import { reads } from "@ember/object/computed";
import { validator, buildValidations } from "ember-cp-validations";
import { getOwner } from "@ember/application";
const Validations = buildValidations({
billing_first_name: {
descriptionKey: "form.fields.billing_first_name",
@lifeart
lifeart / index.html
Last active Feb 6, 2020
GlimmerLite web components example
View index.html
<!doctype html>
<html>
<head>
<title>Glimmer Demo</title>
</head>
<body>
<script src="./app.bundle.js"></script>
<example-app />
</body>
</html>
@lifeart
lifeart / glimmer.js
Created Dec 9, 2019
GlimmerVueHooks
View glimmer.js
import { set } from '@ember/object';
function store(initValue) {
let context = null;
let propName = null;
let getter = {
get value() {
retun initValue
}
}
@lifeart
lifeart / ability.ts
Last active Jan 17, 2020
Simple Roles Management
View ability.ts
import { get } from '@ember/object';
const permissions = {
study: {
see: ['STUDY_MANAGER', 'DATA_ENTRY', 'ADMIN'],
create: ['DATA_ENTRY', 'ADMIN'],
edit: ['STUDY_DIRECTOR', 'DATA_ENTRY', 'ADMIN'],
}
}
View components.my-component.js
import Ember from 'ember';
function vueComponentWrapper(
Component,
{ container, data = {}}
) {
const mountNode = document.createElement("div");
container.appendChild(mountNode);
var ComponentClass = Vue.extend(Component);
var instance = new ComponentClass({
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
mutate() {
this.set('items', [1,2,3]);
}
}
});
View controllers.application.js
import Ember from 'ember';
function useState(defaultValue, updateValue) {
}
export default Ember.Controller.extend({
init() {
this._super(...arguments);
@lifeart
lifeart / components.my-component.js
Last active Sep 21, 2019
Ember Vue Component API
View components.my-component.js
import vue from '../utils/vue';
export default vue({
data() {
return {
name: 1,
items: [],
james: {
name: 12
}
You can’t perform that action at this time.