Skip to content

Instantly share code, notes, and snippets.

View davismj's full-sized avatar
🎓
Computing normal vectors.

Matthew James Davis davismj

🎓
Computing normal vectors.
View GitHub Profile

The "Pressured Christian" Narrative

So I've read a few articles and watched a few vlogs recently trying to pinpoint why some progressives are going completely nuts recently and why the next generation is turning more and more to libertarianism. One hypothesis I appreciated was the idea that this is the consquence of a generation that abandoned values in favor of postmodernism. A common narrative that I've heard since the George W days was that of the "pressured christian", the kid who had religion "forced" on them when they were young. Especially in the 2000s under George W, the feelings of having religion "forced" on them moved into their political lives, emboldening them to fight back. Ironically, in their frustration I think they've made the very same mistakes of pushing their ideology on others, an

function fizzBuzz(first, second, iterations = 100, output = (value) => console.log(value)) {
first = parseInt(first);
second = parseInt(second);
const third = first * second;
iterations = parseInt(iterations);
if (isNaN(third) || isNaN(iterations) || typeof output !== 'function') {
return console.error('Proper usage: fizzBuzz(first: Number, second: Number, iterations: Number, output: Function)');
}
for (let i = 1; i <= iterations; i++) {
if (i % third === 0) {
@davismj
davismj / app.html
Created August 4, 2017 10:34
Custom Event Delegation
<template>
<require from="myCustomElement"></require>
<my myevent.delegate="myFunction($event)"></my>
</template>
@davismj
davismj / app.html
Last active May 17, 2020 05:02 — forked from AshleyGrant/app.html
Activation and Children Order
<template>
app
<router-view></router-view>
</template>
@davismj
davismj / with-di.js
Created August 7, 2017 10:00
di vs no di
export class MyViewModel {
// this is what the @inject(Element) decorator does to the MyViewModel class under the hood.
static inject = [Element];
constructor(element) {
this.el = element;
}
}
@davismj
davismj / myUnitTest.spec.js
Created August 7, 2017 10:18
DI and Unit Testing
import { Container } from 'aurelia-dependency-injection';
describe('the unit test', () => {
let container;
beforeEach() {
container = new Container();
// Off the top of my head, I'm not sure how we would create an element in jasmine. I want to say it would look something like this. Since this isn't what you're really interested in, I'm just leaving it like this for now. It's probably wrong.
container.registerInstance(Element, new Element());
}
@davismj
davismj / myModel.js
Last active August 7, 2017 10:42
Customizing the Aurelia dependency injection behaviors
// MyModel is a class that represents a database object.
export class MyModel {
name;
address;
telephone;
constructor(obj) {
this.name = obj.name;
this.address = obj.address;
this.telephone = obj.telephone;
@davismj
davismj / app.html
Last active August 17, 2017 11:20 — forked from jdanyow/app.html
Handwritten Drag and Drop
<template>
<style>
.list {
user-select: none;
}
.list + .list {
margin-top: 1em;
}
.list-item {
border: 1px solid;
@davismj
davismj / app.html
Created August 7, 2017 10:58
Aurelia Gist
<template>
<div>
date is ${date}
</div>
<div>
myClass.date is ${myClass.date}
</div>
<div>
Object.is(date, myClass.date) is ${is(date, myClass.date)}
</div>