Skip to content

Instantly share code, notes, and snippets.

View krimple's full-sized avatar

Ken Rimple krimple

  • Philadelphia, PA
  • 20:55 (UTC -05:00)
View GitHub Profile
@krimple
krimple / 00-setup.md
Last active May 8, 2019 15:18
Philly DevDays 2019 Snippets
@krimple
krimple / 00-docker-compose.yml
Last active May 3, 2019 16:59
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.
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 December 10, 2018 16:37
Working 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 December 9, 2018 16:28 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
# 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 September 16, 2016 19:03
Object.create isn't a direct clone - it's a prototype assignment
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 June 7, 2018 15:37
Test and class under test for Http mocking - Angular 2 beta 1

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 January 28, 2015 19:33
Using angular.copy for modal fetch and update of data
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 17:51
The problem create.tagx file
<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 17:49
Incorrect form Configuration for using tags (embeds 'tag' as field)
<?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 17:47
Example Spring JUnit test to verify Roo converters
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;