Skip to content

Instantly share code, notes, and snippets.

Pablo Brasero pablobm

View GitHub Profile
@pablobm
pablobm / components.my-component.hbs
Created Aug 16, 2018
Valid paths for component templates
View components.my-component.hbs
<p>This is the component</p>
View controllers.application.js
import Ember from 'ember';
const { computed, get } = Ember;
export default Ember.Controller.extend({
queryParams: ['foo', 'bar'],
foo: '',
bar: '',
formattedModel: computed('model.{foo,bar}', function() {
@pablobm
pablobm / controllers.application.js
Last active May 6, 2018
Ember: default behaviour of `Route#model()`
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@pablobm
pablobm / components.-text-field.js
Last active Apr 22, 2018
Ember: Overriding built-in components
View components.-text-field.js
import Ember from 'ember';
export default Ember.TextField.extend({
attributeBindings: ['data-toggle', 'data-placement']
});
@pablobm
pablobm / README.md
Last active Aug 20, 2017
Phidgets, event-driven
View README.md
@pablobm
pablobm / config.ru
Created Aug 19, 2016
Rack server that prints out any requests
View config.ru
# Run as follows:
#
# rackup -o 0.0.0.0 -O Threads=0:1
#
require 'json'
require 'pp'
run (Proc.new do |env|
req = Rack::Request.new(env)
@pablobm
pablobm / tests__acceptance__errors-test.js
Last active Sep 29, 2017
Ember.js: error state workaround
View tests__acceptance__errors-test.js
// This is an example of use of `errorStateWorkaround`
import Ember from 'ember';
import { test } from 'qunit';
import moduleForAcceptance from 'my-app/tests/helpers/module-for-acceptance';
import errorStateWorkaround from 'my-app/tests/helpers/error-state-workaround';
moduleForAcceptance("Acceptance | errors", {
beforeEach: function() {
errorStateWorkaround.setup(err => {
// Return `true` if `err` is the error
@pablobm
pablobm / reduce_rspec_failure_context.rb
Created May 19, 2016
Run RSpec in a loop, noting what tests were run before the first failure
View reduce_rspec_failure_context.rb
require 'json'
require 'pp'
require 'sequel'
module CaptureOutput
module_function
def capture_stdout(&block)
Private.capture(STDOUT, &block)
end
View gist:f096e7f5db615a92996be1e4f622079f
Verifying that +pablobm is my blockchain ID. https://onename.com/pablobm
@pablobm
pablobm / README.md
Last active May 25, 2016
Ember workshop - setup
View README.md

Preparation

Please install the following:

  • The Ladder API app (Rails)
  • A newly created, empty Ember app
  • Ember Inspector extension for your browser

Please do this ahead of the workshop. There are a few things that can go wrong. Even if they don't, downloading all npm dependencies is slow.

You can’t perform that action at this time.