Skip to content

Instantly share code, notes, and snippets.

Avatar

Ken Rimple krimple

View GitHub Profile
@krimple
krimple / 00-setup.md
Last active May 8, 2019
Philly DevDays 2019 Snippets
View 00-setup.md
@krimple
krimple / 00-docker-compose.yml
Last active May 3, 2019
A full-stack Docker configuration with Dockerfiles and docker-compose. Repo and multiple blog posts coming soon. Note - couldn't put directory names in file names, so underscores replace folders.
View 00-docker-compose.yml
version: "3.7"
services:
apache:
container_name: quizzo-apache
build:
context: ./apache/
dockerfile: Dockerfile-apache
volumes:
- ${CONFIG_DIR}/apache/httpd.conf:/usr/local/apache2/conf/httpd.conf:ro
@krimple
krimple / wsl.conf
Created Dec 10, 2018
Working wsl.conf
View wsl.conf
[automount]
enabled = true
root = /mnt/
options = "metadata,umask=22,fmask=11"
mountFsTab = false
[network]
generateHosts = true
generateResolvConf = true
@krimple
krimple / boxstarter.ps1
Last active Dec 9, 2018 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
View boxstarter.ps1
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@krimple
krimple / demo.ts
Created Sep 16, 2016
Object.create isn't a direct clone - it's a prototype assignment
View demo.ts
class Foo {
constructor(public bar: string) { }
}
let f1 = new Foo('demovalue');
let f2 = Object.create(f1);
console.log(`f1 = ${JSON.stringify(f1)}`);
console.log(`f2 = ${JSON.stringify(f2)}`);
f1.bar = 'changed';
@krimple
krimple / README.md
Last active Jun 7, 2018
Test and class under test for Http mocking - Angular 2 beta 1
View README.md

This snippet is a working example of a test against the Http service in Angular 2.0.

It is a very simple test, and provides an example of how to:

  • Provide the right wiring to the test injector
  • Inject the fake XHRBackend (i.e. MockBackend)
  • Define a potential request
  • Run the request in the framework
  • Set expectations on the result
@krimple
krimple / gist:536095a76c383b5b4df6
Created Jan 28, 2015
Using angular.copy for modal fetch and update of data
View gist:536095a76c383b5b4df6
angular.module('myApp').service('greeterService',
['$log', function($log) {
var namesSpokenTo = [];
this.sayHello: function(name) {
namesSpokenTo.push(name);
$log.debug('hello, ' + name);
};
this.getNames = function() {
return angular.copy(namesSpokenTo);
};
@krimple
krimple / gist:2623501
Created May 6, 2012
The problem create.tagx file
View gist:2623501
<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" version="2.0">
<jsp:output omit-xml-declaration="yes"/>
<jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)"/>
<jsp:directive.attribute name="modelAttribute" type="java.lang.String" required="true" rtexprvalue="true" description="The name of the model attribute for form binding"/>
<jsp:directive.attribute name="path" type="java.lang.String" required="true" rtexprvalue="true" description="Specify the relative URL path (wit leading /)" />
<jsp:directive.attribute name="compositePkField" type="java.lang.String" required="false" rtexprvalue="true" description="The field name of the composite primary key (only us
@krimple
krimple / gist:2623491
Created May 6, 2012
Incorrect form Configuration for using tags (embeds 'tag' as field)
View gist:2623491
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<div xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:field="urn:jsptagdir:/WEB-INF/tags/form/fields"
xmlns:form="urn:jsptagdir:/WEB-INF/tags/form"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:spring="http://www.springframework.org/tags" version="2.0">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<jsp:output omit-xml-declaration="yes"/>
<form:create id="fc_com_t_coursemanager_model_Tag" modelAttribute="tag"
@krimple
krimple / gist:2623484
Created May 6, 2012
Example Spring JUnit test to verify Roo converters
View gist:2623484
package com.t.coursemanager.web;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import org.apache.log4j.Logger;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
You can’t perform that action at this time.