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
// fizzbuzz ramda-style | |
var R = require('ramda'); | |
R.forEach(R.cond([ | |
[R.pipe(R.modulo(R.__, 15), R.equals(0)), R.always('FizzBuzz')], | |
[R.pipe(R.modulo(R.__, 3), R.equals(0)), R.always('Fizz')], | |
[R.pipe(R.modulo(R.__, 5), R.equals(0)), R.always('Buzz')], | |
[R.T, R.identity] | |
]), R.range(1, 101)); | |
//with a helper function |
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
var R = require('ramda'); | |
var factorOf = R.compose(R.equals(0), R.flip(R.modulo)); | |
var getFizzBuzz = R.cond([ | |
[factorOf(15), R.always('FizzBuzz')], | |
[factorOf(5), R.always('Buzz')], | |
[factorOf(3), R.always('Fizz')], | |
[R.T, R.identity] | |
]); |
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/sh | |
# ================================================================== | |
# ______ __ ____ | |
# /_ __/___ ____ ___ _________ _/ /_ ( __ ) | |
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / __ | | |
# / / / /_/ / / / / / / /__/ /_/ / /_ / /_/ / | |
# /_/ \____/_/ /_/ /_/\___/\__,_/\__/ \____/ | |
# | |
# Multi-instance Apache Tomcat installation with a focus | |
# on best-practices as defined by Apache, SpringSource, and MuleSoft |
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
const mapping = (f) => (reducing) => (result, input, index) => reducing(result, f(input, index)); | |
const filtering = (predicate) => (reducing) => (result, input, index) => predicate(input) ? reducing(result, input, index) : result; | |
const ALPHABET = 'abcdefghijklmnopqrstuvwxyz'.split(''); | |
const NUMBERS = '0123456789'.split(''); | |
const isAlphaNumeric = (letter) => ALPHABET.indexOf(letter) !== -1 || NUMBERS.indexOf(letter) !== -1; | |
const periodicallyPad = (current, index) => index !== 0 && index % 5 === 0 ? ' ' + current : current; | |
const concatenate = (xs, x, index) => xs.concat(x); | |
const result = 'I AM SO EXCITED ABOUT TRANSDUCERS'.toLowerCase().split('') |
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
Snapshot of Khan Academy's BigBingo A/B testing framework and related code. | |
Here's a basic overview: | |
-summarize.py is the most interesting file. It contains all stages of the | |
summarize task, as well as the publish and archive steps that happen at the | |
end. | |
-bq_pipelines.py contains lots of useful pipelines for interacting with | |
BigQuery. QueryToTableBatchPipeline can run many simultaneous queries, and will | |
properly handle all batching and retry logic. | |
-config.py is where all experiment configuraiton lives. For this Gist, I |
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 | |
# expects the lambda function .py file to be in the same directory as this script. | |
# based off of Amazon's official documentation: | |
# http://docs.aws.amazon.com/lambda/latest/dg/with-s3-example-deployment-pkg.html#with-s3-example-deployment-pkg-python | |
# get the lambda function | |
lambda_func_file=$1 | |
lambda_func="${lambda_func_file%.*}" | |
# exit if no file specified | |
[[ -z "$1" ]] && { echo "Lambda function is empty" ; exit 1; } | |
# generate a deployment timestamp |
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/env python | |
import argparse | |
import logging | |
try: | |
from urllib import splittype | |
except ImportError: | |
from urllib.parse import splittype | |
import boto3 |
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 | |
usage() { | |
echo " | |
Usage: wti [-h?] [-l LOGIN] ISSUE... | |
wti = \"(W)hat (T)he (I)ssue?\". Script tries to get description of the specified | |
ISSUE(es) from jira. For each ISSUE in list script will ouput the line in | |
the following format: ISSUE_ID — ISSUE_DESC |
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 | |
#This script requires an up-to-date version of the aws cli tool | |
profile=$1 | |
environment=$2 | |
region=us-east-1 | |
service_name=com.amazonaws.$region.s3 | |
get_env_vpc_id () { |
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
{ | |
"method": "$context.httpMethod", | |
"resourcePath": "$context.resourcePath", | |
"querystring": { | |
#foreach($key in $input.params().querystring.keySet()) | |
"$key": "$input.params().querystring.get($key)"#if($foreach.hasNext),#end | |
#end | |
}, | |
"path": { | |
#foreach($key in $input.params().path.keySet()) |
OlderNewer