Skip to content

Instantly share code, notes, and snippets.

@BriceShatzer
BriceShatzer / answer.md
Last active January 11, 2017 01:08
js answer explanation

The two functions they provide are basically identical, with the only difference being the comparison that they are making. Hopefully talking through an example use of one, step by step will help...

So lets say we have an example array of numbers that look like this [7,12,5].

When we call the max() function and pass that array of number into it like this:

max( [7,12,5] );

// or this:

First, I would need to weigh the opportunity cost of performing the task myself vs outsourcing it to a service provider (laundry mat, app/service, dry cleaner). To find that opportunity cost, I would multiply the estimated amount of time that it would take to complete the task in its entirety by what I feel is the current value of my time. This "current value of my time" is an amalgamation of multiple, context specific factors (e.g. my professional hourly rate, how imminent the need for clean cloths/a specific garment is, the value & urgency of other tasks that could be accomplished). If the opportunity cost of performing the task myself is greater than the cost of outsourcing it to a service provider, then it should be outsourced.

If it is determined that the task should be performed by me, I would start by first separating the laundry into piles of like colors. Then each pile would be subjected to the following process, with each pile going through the process completely prior to the next pile beginning

// ==UserScript==
// @name Replace investors.com stylesheet with local copy
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @run-at document-start
// @match http://www.investors.com/*
// @match http://www.dev7investors.com/news*
// @grant none

#Getting all media queries present in a stylesheet

Note: Access to the cssRules attribute is subject to the cross-origin policy
Some thoughts on getting around that issue here

var mediaQueriesMap = new Map();

var rules;
@BriceShatzer
BriceShatzer / example.js
Last active September 29, 2015 16:58
Basic AJAX Request
var response;
function makeRequest (url) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function(){
if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
response = xmlhttp.responseText;
}
}
  • Packback-Common
  • Engineering Docs
    • ✔️merge sass & foundation mixins into a single page
    • include updated kitchen sink and explore a better way of integrating it with the repo
    • ✔️document current import strategy/structure for using packback-common in a project
  • Packback Wiki
  • setup some sort of content backup
var finalhandler = require('finalhandler');
var http = require('http');
var serveStatic = require('serve-static');
var request = require('request');
var fs = require('fs');
var serve = serveStatic('public');
request('http://api.dronestre.am/data').pipe(fs.createWriteStream('public/data.json'));
//request.get('http://api.dronestre.am/data').pipe(request.put('localhost:8080/livedata.json'));
"font_face": "Consolas",
"font_size": 13,
---
"font_face": "Monospace Regular",
"font_size": 12,
---
"font_face": "Droid Sans Mono",
"font_size": 12/13,
---
"font_face": "FreeSans Mono",