Skip to content

Instantly share code, notes, and snippets.

View mattmazzola's full-sized avatar

Matt Mazzola mattmazzola

View GitHub Profile
@mattmazzola
mattmazzola / designer.html
Created September 23, 2015 21:02
designer
<link rel="import" href="../google-map/google-map.html">
<link rel="import" href="../speech-mic/speech-mic.html">
<link rel="import" href="../google-map/google-map-directions.html">
<link rel="import" href="../core-input/core-input.html">
<polymer-element name="my-element">
<template>
<style>
:host {
@mattmazzola
mattmazzola / RegexCors.cs
Created September 25, 2015 07:01
CORS Attribute that matches based on regular expression from Web.config
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Net.Http;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using System.Web.Cors;
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
things: [
{ id: 1, name: 'a' },
{ id: 2, name: 'b' },
{ id: 3, name: 'c' }
]
@mattmazzola
mattmazzola / application.controller.js
Created October 21, 2015 06:27
Selection Add Class
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
selectedItem: null,
things: [
{ name: 'a' },
{ name: 'b' },
{ name: 'c' }
],
@mattmazzola
mattmazzola / expense-summary.component.js
Last active October 28, 2015 06:42
Dockyard Article possible bug in expense-summary/component.js
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
amountChanged() {
const expense = this.get(this, 'expense');
//this.sendAction('update', expense); <-- Typo? Should be 'ammountChanged' instead of 'update'
// Everything works in the twiddle, but I think the names were changed in the article.
// The first argument to sendAction should be the name of the action
@mattmazzola
mattmazzola / component.ts
Last active April 12, 2016 06:18
Angular 1.4x Component
class Controller {
$scope: ng.IScope;
$timeout: ng.ITimeoutService;
MyService: MyService;
static $inject = [
'$scope',
'$timeout',
'MyService'
@mattmazzola
mattmazzola / component.ts
Created April 12, 2016 06:08
Angular 1.5x Component
class Controller {
$element: ng.IAugmentedJQuery;
$scope: ng.IScope;
$timeout: ng.ITimeoutService;
MyService: MyService;
static $inject = [
'$scope',
'$element',
'$attrs',
import Ember from 'ember';
export default Ember.Component.extend({
didRender() {
if(this.validateAttributes()) {
this.embed(this.$());
}
},
import Ember from 'ember';
const {
observer
} = Ember;
export default Ember.Component.extend({
thing: null,
optionsObserver: observer('thing.{prop3}', function () {
@mattmazzola
mattmazzola / controllers.application.js
Created April 28, 2016 22:40
Ember Checkbox with Submit action
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
filterPaneEnabled: false,
filterPaneEnabled2: false,
actions: {
form2submitted() {
console.log('form 2 submitted');