Skip to content

Instantly share code, notes, and snippets.

View mitchell-garcia's full-sized avatar
🐶

Mitchell Garcia mitchell-garcia

🐶
View GitHub Profile
@mitchell-garcia
mitchell-garcia / vue.d.ts
Last active October 1, 2017 05:29
Vue Typescript Typings for Typescript Version 2.4+
declare module "*.vue" {
import Vue from "vue";
import { ComponentOptions } from "vue";
export default typeof Vue as ComponentOptions<Vue>;
}
// most literally copied from https://github.com/preboot/angular-webpack/blob/master/webpack.config.js - view for reference
var webpack = require('webpack');
var autoprefixer = require('autoprefixer');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
/**
* Env
* Get npm lifecycle event to identify the environment
@mitchell-garcia
mitchell-garcia / kc.js
Created April 8, 2016 17:06
Example of binding attribute to style
export default Ember.Component.extend({
attributeBindings: ['background:style'],
size: 'medium',
background: computed('user.[]', function() {
const email = this.get('user.email');
const size = this.get('size');
const defaultAvatar = `//www.gravatar.com/avatar/${md5(email)}.jpg`;
const avatar_path = this.get('user.avatar') ? this.get('user.avatar') : defaultAvatar;