Skip to content

Instantly share code, notes, and snippets.

View beattyml1's full-sized avatar

Matthew Beatty beattyml1

View GitHub Profile
@beattyml1
beattyml1 / Interview Questions.md
Last active June 11, 2016 18:51
Interview Questions

Ethics and culture and Perks

  • How do you bias toward ethics and positive actors
  • How does your product improve the world or everyday peoples experience of the world
  • How do you balance giving everyone a voice and not bogging people down with non-relevant decisions/getting shit done
  • What is the roll of management in your org
    • Enable/facilitate/remove obstacles vs control/command
  • How flexible is the schedule? Why not more?
  • Is remote work possible? How often? Why not more?
  • What is average per year compensation increase?
  • How often does the team work overtime? How much does that usually look like? Do they usually take it easy afterwards to recover?

Rules of layers

  • Every layer must provide significant/mearusable value
  • Every layer should for every method provide auto-implementing defaults off of the lower layer or should add significant logic to that method, or should be a completely new method built from business logic functions and lower layer functions
  • Every layer must have any dependencies (if any) passed in or injected
  • Every layer should try as much as possible to assemble logic from dependency free/fully indpendent business modules rather than including business logic in layers
  • Every component in a layer should be as small as possible favoring co-services to additional layers

Smells of bad layers

  • You write the same code over and over
  • You have layers where you repeatedly write a layer calling the lower layer with no addtional logic (and thus value) added
namespace MicroGate
{
public class Route
{
public bool KeepResourceName { get; set; }
public string BaseUrl { get; set; }
public Func<string, string, HttpRequest, bool> Authenticate { get; set; }
public Func<string, string, HttpRequest, bool> Authorize { get; set; }
public IEnumerable<Func<string, string, bool>> AdditionalAllowFunctions { get; set; }
public Func<string, string, WebRequest, WebRequest> RequestTransfroms { get; set; }
@beattyml1
beattyml1 / Source
Last active August 29, 2015 14:23
AJ
var AJ = (function() {
var jsonRequest = function(verb, path) {
return function(data, callback) {
var req = new XMLHttpRequest();
req.open(verb, path, true);
req.onreadystatechange = callback;
req.send(JSON.stringify(data));
}
};
var queryString = function(data) {
var AJ = (function() {
var jsonRequest = function(verb, path) {
return function(data, callback) {
var req = new XMLHttpRequest();
req.open(verb, path, true);
req.onreadystatechange = callback;
req.send(JSON.stringify(data));
}
};
var queryString = function(data) {
@beattyml1
beattyml1 / gist:5d05cfcfa87bb2ecdfee
Last active August 29, 2015 14:16
Functional First TypeScript Doodle
// really more a struct/interface
class DataStore {
store: (object: any) => string;
get: (key: string) => any;
}
class JsonDataStore: DataStore {
getRawJson: () => string;
static create(fileWriter: FileWriter): JsonDataStore {
@beattyml1
beattyml1 / Async.ts
Created February 28, 2015 21:52
First Attempt on an asynchronous function array handling
module Async {
export function map<TIn, TOut>(input: Array<TIn>, processor: (item: TIn, after:(outputItem: TOut)=>void)=>void, returns: (output: Array<TOut>)=>void){
var results = [];
forEach(input, (item, index, checkIfDone)=>processor(item, function(outputItem){
results[index] = outputItem;
checkIfDone();
}), function(){
returns(results);
});
}