Skip to content

Instantly share code, notes, and snippets.

View Gaurav0's full-sized avatar
💭
I'm looking for new opportunities!

Gaurav Munjal Gaurav0

💭
I'm looking for new opportunities!
View GitHub Profile
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
import Controller from '@ember/controller';
import { action } from '@ember/object';
export default class AnimationSimpleDivDrag extends Controller {
// initialise grid properties
dragCardPositionDelta = { dx: 0, dy: 0 };
isDraggingCard = false;
constructor(...args) {
super(...args);
@Gaurav0
Gaurav0 / components.ui-checkbox\.js
Created September 15, 2020 02:03
Why Ember Demo
import Component from '@glimmer/component';
import { guidFor } from '@ember/object/internals';
export default class extends Component {
elementId = null;
constructor() {
super(...arguments);
this.elementId = guidFor(this);
<ol>
<li>Open browser dev tools</li>
<li>click "Make True"</li>
<li>click "Make False"</li>
<li>Notice an error in the console</li>
</ol>
<button {{on 'click' this.makeTrue}}>
Make True
</button>
@Gaurav0
Gaurav0 / controllers.application\.js
Last active June 11, 2020 22:23 — forked from gabrielgrant/controllers.application\.js
persistent mapbox markers MCVE
import Controller from '@ember/controller';
import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';
import 'mapbox-gl';
const center = {lng: 79.3832, lat: 43.6532};
function generateModel() {
return Array(3).map(pt => ({
lng: center.lng + Math.random() / 10,
import Component from '@ember/component';
export default Component.extend({});
@Gaurav0
Gaurav0 / components.my-component\.js
Created March 12, 2020 03:03 — forked from jelhan/components.my-component\.js
ember-bootstrap-changeset-validations-upgrade-v3-bug
import Ember from 'ember';
import Changeset from 'ember-changeset';
import lookupValidator from 'ember-changeset-validations';
import { validateLength } from 'ember-changeset-validations/validators';
const Validations = {
name: validateLength({ min: 2 }),
};
export default Ember.Component.extend({
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle Test'
});
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['card', 'rental-card']
});
@Gaurav0
Gaurav0 / mirage.config.js
Last active November 20, 2018 19:10 — forked from samselikoff/mirage.config.js
Mirage dev boilerplate
export default function() {
this.get('users/:id');
};