Skip to content

Instantly share code, notes, and snippets.

View cibernox's full-sized avatar
🏠
Working from home

Miguel Camba cibernox

🏠
Working from home
View GitHub Profile
#!/usr/bin/env ruby
# vim: set syntax=ruby
# Ensures that changes to the Rails schema.rb file may only be committed if a
# migration file is also committed at the same time.
def schema_modified?
%x[ git diff --cached |grep schema.rb ] == ''
end
import Ember from 'ember';
const { computed } = Ember;
export default Ember.Controller.extend({
items: [{
name: 'Foo',
state: {
isActive: true
}
}, {
@cibernox
cibernox / monitor.md
Last active May 19, 2016 10:12 — forked from madhurtandon/monitor.md
Monitor rules

INPUT_TYPE=INTEGER, FLOAT, STRING

Payload: No differences here

{
	"title": "Sample",
	"predicate_collections": [{
		"propositions": [{
			"field": "cases.subject",
@cibernox
cibernox / components.file-chooser.js
Created May 22, 2016 17:17 — forked from chrism/components.file-chooser.js
File Chooser Tests - Ember 2.4.5
import Ember from 'ember';
const {
run: {
bind
}
} = Ember;
export default Ember.Component.extend({
label: 'choose a file',
@cibernox
cibernox / components.file-chooser.js
Created May 22, 2016 19:00 — forked from chrism/components.file-chooser.js
File Chooser Tests Native Events - Ember 2.5.1
import Ember from 'ember';
const { testing } = Ember;
export default Ember.Component.extend({
actions: {
filesChanged(event) {
const files = testing ? event.emberTestingFiles : event.target.files;
if (files.length === 0) {
Ember.Logger.log('you must add a file');
} else if (files.length > 0) {
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['box-field']
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
options: ['option 1', 'option 2', 'option 3'],
selectedOtions: [],
actions: {
select(items) {
this.set('selectedOptions', items);
}
@cibernox
cibernox / controllers.application.js
Last active September 18, 2016 13:08
InputPlaceholderTrue
import Ember from 'ember';
export default Ember.Controller.extend({
foo: ''
});
@cibernox
cibernox / components.my-component.js
Created February 9, 2017 15:57 — forked from amk221/components.my-component.js
Promise Proxy integration test
import computed from "ember-computed";
import DS from 'ember-data;
export default Ember.Component.extend({
proxy: computed(function() {
return DS.PromiseProxy.create({
promise: this.getAttr('my-promise')
});
})
});
import Ember from 'ember';
export default Ember.Component.extend({
disabled: Ember.computed.reads('group.disabled'),
groupName: Ember.computed.reads('group.groupName'),
cancelClose: false,
// Hooks
didReceiveAttrs() {
this._super(...arguments);
Ember.run.scheduleOnce('actions', this, this.checkIfSubItemIsHighlighted);