Skip to content

Instantly share code, notes, and snippets.

View AshleyGrant's full-sized avatar

Ashley Grant AshleyGrant

View GitHub Profile
@AshleyGrant
AshleyGrant / flickr-api.js
Last active August 29, 2015 14:14
flickr.js
import {HttpClient} from 'aurelia-http-client';
var url = 'http://api.flickr.com/services/feeds/photos_public.gne?tags=rainier&tagmode=any&format=json';
export class FlickrApi{
static inject() { return [HttpClient]; }
constructor(http){
this.http = http;
}
Error 1 npm install jscs error: npm WARN package.json @ No description
npm WARN package.json @ No repository field.
npm WARN package.json @ No README data
npm http GET https://registry.npmjs.org/jscs
npm http 304 https://registry.npmjs.org/jscs
npm http GET https://registry.npmjs.org/esprima
npm http GET https://registry.npmjs.org/esprima-harmony-jscs/1.1.0-tolerate-import
npm http GET https://registry.npmjs.org/estraverse
npm http GET https://registry.npmjs.org/exit
npm http GET https://registry.npmjs.org/lodash.assign
<template>
<section>
<h2>${heading}</h2>
<div>
<div class="col-md-2">
<ul class="well nav nav-pills nav-stacked">
<li repeat.for="row of router.navigation" class="${row.isActive ? 'active' : ''}">
<a href.bind="row.href">${row.title}</a>
${heading}
</li>
import {Behavior} from 'aurelia-framework';
export class InnerHTML {
static metadata(){
return Behavior
.attachedBehavior('inner-html')
.withOptions().and( x => {
x.withProperty('value');
x.withProperty('sanitizer')
});
@AshleyGrant
AshleyGrant / log.txt
Created February 18, 2015 17:54
How to rebase a branch
Ashley@WE2015DEV ~/git_temp
$ git init
Initialized empty Git repository in c:/Users/Ashley/git_temp/.git/
Ashley@WE2015DEV ~/git_temp (master)
$ echo 1 > file.txt
Ashley@WE2015DEV ~/git_temp (master)
$ git add file.txt
warning: LF will be replaced by CRLF in file.txt.
import {Router} from 'aurelia-router';
import bootstrap from 'bootstrap';
export class App {
static inject() { return [Router]; }
constructor(router) {
this.router = router;
}
}
@AshleyGrant
AshleyGrant / FileResultThatHandlesIE8.cs
Created May 20, 2015 14:47
ASP.Net MVC 5 FileContentResult that handles IE8. Can't claim credit for this. Putting here for anyone to use
using System;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace AshleyGrant.Web
{
public class FileResultThatHandlesIE8 : FileContentResult
{
private readonly string _fileName;
@AshleyGrant
AshleyGrant / gist:73a94661211b6a042b2d
Last active August 29, 2015 14:28
Aurelia Skeleton Quickstart
#Use chocolatey to install nodejs (or skip this and dl and install it yourself)
choco install nodejs.install -y
#Open a new terminal window to make sure npm is on your path
#Install the stuff you'll need to quickly get up and running
npm install -g jspm gulp yo generator-aurelia karma-cli
#configure your github creds for jspm
jspm registry config github
@AshleyGrant
AshleyGrant / cla.md
Created December 29, 2015 03:29
CLA test

#CLA

Sign the CLA yo! Because you agree and stuff.

@AshleyGrant
AshleyGrant / app.html
Created March 11, 2016 15:37 — forked from jdanyow/app.html
Aurelia Gist
<template>
<div style="height: 125px; min-width: 150px; width: 100%;" ref="canvasContainer">
<canvas ref="canvas" width.one-way="canvasContainer.offsetWidth"></canvas>
</div>
</template>