Skip to content

Instantly share code, notes, and snippets.

View leondmello's full-sized avatar

Leon Dmello leondmello

  • Bloomberg L.P.
  • New York
View GitHub Profile
@leondmello
leondmello / Gemfile
Last active June 22, 2020 17:45
Bundler unable to find native extension gems in ./vendor/bundle
gem 'capistrano', '3.5.0'
gem 'capistrano-bundler', '~> 1.2.0'
gem 'capistrano-rails', '~> 1.2.2'
gem 'capistrano-scm-copy', '0.7.0'
gem 'capistrano3-puma', '1.2.1'
gem 'puma', '~> 3.7'
gem 'rails', '~> 5.2'
group :development do
import Ember from 'ember';
import { computed } from '@ember/object';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
color: 'none',
isGreen: computed('', function() {
return this.get('color') === 'green';
}),
isGreenCorrect: computed('color', function() {
import DS from 'ember-data';
import ModelMixin from 'ember-data-extensions/mixins/model';
import { memoize, startCase } from 'lodash-es';
import { get, set } from '@ember/object';
export default class ApplicationModel extends DS.Model.extend(ModelMixin).reopenClass({
attributeLabels: memoize(
function (this: ApplicationModel, store: any): object {
const labelMap = {
self: this.modelViewName()
@leondmello
leondmello / controllers.application.js
Last active October 4, 2018 00:29
OneWay CP issue
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@leondmello
leondmello / application-model.js
Created April 6, 2018 21:28
Memoizer app model
import DS from 'ember-data';
import ModelMixin from 'ember-data-extensions/mixins/model';
import _ from 'lodash';
const AppModel = DS.Model.extend(ModelMixin);
const modelViewName = _.memoize(function () {
<some code>
}, function () {
return this.modelName;
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Component.extend({
valueMap: Ember.Object.create({
3600: 'One Update Per Hour',
86400: 'One Update Per Day',
604800: 'One Update Per Week',
2629746: 'One Update Per Month'
}),
import Ember from 'ember';
export default Ember.Component.extend({
valueMap: Ember.Object.create({
3600: 'One Update Per Hour',
86400: 'One Update Per Day',
604800: 'One Update Per Week',
2629746: 'One Update Per Month'
}),
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
routeBy: "b",
items: ["a", "b", "c"]
});
import Ember from 'ember';
import {
validator,
buildValidations
}
from 'ember-cp-validations';
const Validations = buildValidations({
'maxUpdates': validator('number', {
allowString: true,