paymentModelFunction = function(gbHours, telemReports, downloadedBytes) {
gbHoursScaled = (gbHours - mean(gbHours)) / sd(gbHours)
telemReportsScaled = (telemReports - mean(telemReports)) / sd(telemReports)
downloadedBytesScaled = (downloadedBytes - mean(downloadedBytes)) / sd(downloadedBytes)
basePayout = 10
ghHourPayout = 12.2221 * gbHoursScaled
telemReportsPayout = 0.1452 * telemReportsScaled
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -s "$url" | tar -zxC "$dest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# ^^^ YAML documents must begin with the document separator "---" | |
# | |
#### Example docblock, I like to put a descriptive comment at the top of my | |
#### playbooks. | |
# | |
# Overview: Playbook to bootstrap a new host for configuration management. | |
# Applies to: production | |
# Description: | |
# Ensures that a host is configured for management with Ansible. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro $do { | |
case ($($x = $y) (,) ...) $body => { | |
(function ($x (,) ...) $body)($y (,) ...) | |
} | |
case $name ($($x = $y) (,) ...) $body => { | |
(function $name ($x (,) ...) $body)($y (,) ...) | |
} | |
} | |
macro $var { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I1217 19:23:11.844920 2201 state.cpp:33] Recovering state from '/tmp/mesos/meta' | |
Incompatible slave info detected. | |
------------------------------------------------------------ | |
Old slave info: | |
hostname: "ip-10-46-210-228.ec2.internal" | |
webui_hostname: "ip-10-46-210-228.ec2.internal" | |
resources { | |
name: "cpus" | |
type: SCALAR | |
scalar { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "stdio.h" | |
#include "stdlib.h" | |
unsigned int max(unsigned int a, unsigned int b) { | |
return a > b ? a : b; | |
} | |
unsigned int bucket(unsigned int val) { | |
return val & 0xF0000000 >> 28; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Except sqlite3 all the libraries are standard that should be present with a Ruby installation. | |
# If you don't have sqlite3 installed. Use `gem install sqlite3` | |
require 'fileutils' | |
require 'sqlite3' | |
require 'uri' | |
require 'net/http' | |
require 'set' | |
require 'thread' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
from __future__ import unicode_literals | |
import os | |
from pdfminer.pdfdocument import PDFEncryptionError | |
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter | |
from pdfminer.converter import TextConverter | |
from pdfminer.layout import LAParams | |
from pdfminer.pdfpage import PDFPage | |
from cStringIO import StringIO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# Deploy built site to this branch | |
TARGET_BRANCH=master | |
# Sync the contents of this directory where the site should have been built | |
SOURCE_DIR=_site | |
if [ ! -d "$SOURCE_DIR" ]; then | |
echo "SOURCE_DIR ($SOURCE_DIR) does not exist, build the source directory before deploying" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
# setup: pip install requests beautifulsoup4 | |
from decimal import Decimal | |
import requests | |
from bs4 import BeautifulSoup | |
import sys | |
# Session setup |
OlderNewer