Skip to content

Instantly share code, notes, and snippets.

View TylerJPresley's full-sized avatar

Tyler J Presley TylerJPresley

View GitHub Profile
@TylerJPresley
TylerJPresley / release.ts
Created January 31, 2018 16:24
Release task for Aurelia projects
import * as gulp from 'gulp';
import * as htmlMin from 'gulp-htmlmin';
import * as gzip from 'gulp-gzip';
import * as del from 'del';
import * as jsonMinify from 'gulp-json-minify';
import * as vinylPaths from 'vinyl-paths';
import * as stripDebug from 'gulp-strip-debug';
import * as stripComments from 'gulp-strip-comments';
const copyFnArray = [];
@TylerJPresley
TylerJPresley / attached.js
Created July 9, 2017 03:05 — forked from peisenmann/attached.js
Aurelia custom attribute to invoke a callback when an element gets added to the dom. Demo: http://plnkr.co/edit/fguuz4
import {customAttribute, bindable, LogManager} from 'aurelia-framework';
const logger:Logger = LogManager.getLogger("attached");
/**
* MIT License. Patrick Eisenmann.
* Apply this attribute to an element to have a callback invoked when the element added to the DOM
*
* @param {Function} callback. Required. The function to be invoked.
* The first argument to the callback is the Element that had the attached on it.
@TylerJPresley
TylerJPresley / app.html
Created June 20, 2017 15:37
DI inheritance
<template>
<div repeat.for="item of items">
<a href="#" click.trigger="toggleRow($index)">${item.name}<span class="fa ${ selectedRow === $index ? 'fa-caret-up' : 'fa-caret-down' }"></span></a>
<div show.bind="selectedRow === $index">
--- ${item.color}
</div>
</div>
</template>
@TylerJPresley
TylerJPresley / tslint.json
Created April 22, 2017 21:02
tslint config
{
"extends": "tslint:latest",
"rules": {
"callable-types": true,
"interface-name": false,
"interface-over-type-literal": true,
"max-classes-per-file": false,
"max-line-length": [true, 500],
"member-ordering": [true, { "order": [
"static-field",
@TylerJPresley
TylerJPresley / app.html
Created March 14, 2017 20:52
DI inheritance
<template>
<h1>${message}</h1>
<table border="1">
<tbody>
<template repeat.for="item of items" containerless>
<tr>
<td>${item.id}</td>
<td>${item.name}</td>
</tr>
@TylerJPresley
TylerJPresley / app.html
Created March 14, 2017 20:51
DI inheritance
<template>
<h1>${message}</h1>
<table border="1">
<tbody>
<template repeat.for="item of items" containerless>
<tr>
<td>${item.id}</td>
<td>${item.name}</td>
</tr>
@TylerJPresley
TylerJPresley / app.ts
Created February 21, 2017 14:57
page watcher and page post render
import { inject } from 'aurelia-framework';
import { Router, RouterConfiguration } from 'aurelia-router';
import { AppStorage } from './_resources/app-storage';
import { AuthorizeStep } from './_resources/authorize-step';
import { PagePostRender } from './_resources/page-post-render';
import { PageWatcher } from './_resources/page-watcher';
/**
* App Class
@TylerJPresley
TylerJPresley / app.html
Last active February 16, 2017 21:26
DI inheritance
<template>
<input type="text" value.bind="_filter">
<hr>
<div repeat.for="item of filteredItems">${item.id} - ${item.text}</div>
</template>
@TylerJPresley
TylerJPresley / app.html
Last active March 7, 2017 19:43
DI inheritance
<template>
<require from="type-ahead-filter-value-converter"></require>
<input type="text" value.bind="_filter">
<hr>
<div repeat.for="item of items | typeAheadFilter:'text':_filter">${item.text}</div>
</template>
@TylerJPresley
TylerJPresley / not-a-file.sh
Created February 5, 2017 03:55
Renewing chef SSL
# Stop the check server so that it can read port 443
sudo chef-server-ctl stop
# Generate the cert
certbot certonly --standalone -d [.....URL.....]
# Cert gets generated in ‘/etc/letsencrypt/live/[.....URL.....]’
# edit the chef server file to make sure it has the right stuff
nano /etc/opscode/chef-server.rb