Skip to content

Instantly share code, notes, and snippets.

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

Stefan Rotariu stfcodes

🏠
Working from home
  • Bucharest
  • 07:00 (UTC +03:00)
View GitHub Profile
@stfcodes
stfcodes / 0 README.md
Created November 22, 2017 21:11 — forked from caseywatts/0 README.md
d3 & c3 npm shim to es6 module for Ember

app.import() works with node_modules now! As of Ember 2.15. Previously it only worked with bower_components and vendor.

Docs for app.import are here: https://ember-cli.com/managing-dependencies#standard-non-amd-asset

This method (vendor-shim) wraps the global export into an es6 module (but the global one is still present). It doesn't use an es6 interface even if the library offers one, but that's okay for my use case.

Things could still be easier, see this thread for the current state of that.

@stfcodes
stfcodes / components.not-working-comp.js
Created March 24, 2017 13:26
Component black magic
import Ember from 'ember';
export default Ember.Component.extend({
// This is not working.
value: Ember.computed('object', 'propertyName', function() {
let prop = Ember.get(this, 'propertyName');
return Ember.get(this, `object.${prop}`);
}).volatile()
import Ember from 'ember';
export default Ember.Component.extend({
loadingIndicator: Ember.inject.service('loading-indicator'),
classNames: ['loading-indicator'],
classNameBindings: ['isLoading'],
isLoading: false,
init() {
@stfcodes
stfcodes / facebook.rb
Created February 24, 2017 08:37 — forked from a14m/facebook.rb
Gist for manually OAuth2 facebook for Rails APIs
# lib/omniauth/facebook.rb
require 'httparty'
module Omniauth
class Facebook
include HTTParty
# The base uri for facebook graph API
base_uri 'https://graph.facebook.com/v2.3'