Skip to content

Instantly share code, notes, and snippets.

View hoffination's full-sized avatar
🗻
keep climbing

Ben Hofferber hoffination

🗻
keep climbing
View GitHub Profile
@hoffination
hoffination / click-outside.ts
Created April 5, 2019 18:15
Angular click outside component functionality
import { Component, OnInit, ElementRef } from '@angular/core';
import { PostsService } from '../post-service';
import 'rxjs/add/operator/map'
@Component({
selector: 'app-post-listing',
templateUrl: './post-listing.component.html',
styleUrls: ['./post-listing.component.css'],
host: {
'(document:click)': 'onClick($event)',
},
@hoffination
hoffination / proxy-record.js
Last active October 10, 2018 15:02
Proxy service to record requests and filter unwanted requests
var express = require('express');
var expressProxy = require('express-http-proxy');
var yakbak = require('yakbak');
/**
* Create proxy service that caches calls
* @param { Object } config
* @param { string } config.serverHost - host of destination service
* @param { number } config.port - port to provide the proxy on localhost
* @param { string } [config.recordDir] - directory to store recordings within (default is /responses)

Technical Leadership and Enablement

Technical leadership is challenging. We look to these leaders to make decisions, mentor developers, lead meetings, and tackle the most difficult problems on our projects. These leaders are considered the "best" developers and are placed in these positions because of consistent performance in the face of challenge. However, I believe that while technical leaders have many roles and responsibilities, they also have a responsibility to enable those they lead. I'm just not sure we know what that looks like.

A "10x developer" is a developer that can do the work of 10 other developers. In our community we've decided that having one person who can do a magnitue more work than others is great, but making 10 or more developers twice as effective is preferable. A team of developers is less likely to leave, tends to perform consistently, and is generally easier to work with than a savant.

This same change of focus from the individual to the entire team is somehow lost when we thi

@hoffination
hoffination / tsconfig.json
Created April 25, 2018 00:04
Best defaults for TypeScript as of Spring 2018
{
"compileOnSave": false,
"compilerOptions": {
"strict": true,
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
@hoffination
hoffination / sever-rendered.js
Created February 6, 2018 20:26
Server rendering with React
const renderApp = () => {
const html = renderToString(React.createFactory(App)({ welcome: 'Hello' }))
return `
<!DOCTYPE html>
<html>
<head>
<title>Server rendered app</title>
</head>
<body>${html}</body>
</html>
@hoffination
hoffination / func_notes.md
Last active September 26, 2017 21:49
Notes on Functional Programming with Ramda
@hoffination
hoffination / countLines.bash
Created July 13, 2017 23:07
line counter
git ls-files | egrep -v /assets/ | egrep -v *.jpg | egrep -v *.html | egrep -v *.xml | egrep -v *.text | egrep -v *.md | egrep -v *.iml | egrep -v *.name | xargs wc -l
http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
@hoffination
hoffination / battle.js
Created July 13, 2017 02:56
Battle simulation for a D&D game
let forces = [{
name: 'enemy',
health: 3360,
random: 10
}, {
name: 'friendly',
health: 2700,
random: 6
}]
@hoffination
hoffination / babel_example.js
Created July 4, 2017 18:24
Babel Example JavaScript
(function (window, document) {
"use strict"
const NAME = 'Ben Hofferber'
let div = document.getElementById('appendToMe')
let h1 = document.createElement('h1')
h1.textContent = `Hello ${NAME}!`
div.appendChild(h1)
@hoffination
hoffination / babel_example.html
Last active July 4, 2017 18:47
Babel Example HTML
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Babel Test</title>
<meta name="description" content="Babel Test Site">
<meta name="author" content="Ben Hofferber">
<script src="node_modules/babel-polyfill/dist/polyfill.min.js"></script>
</head>