All our techniques are being tested and documented in the repository called dummy-api.
- Set up gruntfile structure
- JSHint / code formatting documentation
- JSHint gruntfile
- Set up documentation with docco
- docco gruntfile
- License template system built
All our techniques are being tested and documented in the repository called dummy-api.
We need to make a decision about build tools.
import os.path | |
def dumpVars(r): | |
apivars = [(k, type(getattr(r, k))) for k in dir(r) if not k.startswith('_') and not callable(getattr(r, k))] | |
values = [(k[0], getattr(r, k[0])) for k in apivars] | |
return values | |
print dumpVars(os.path) | |
# This is a small program that tests conversion to and from different formats | |
# and makes sure that numbers that undergo conversion don't lose precision. | |
import math | |
# truncates a number to the given number of digits after the decimal | |
def truncate(x, digits): | |
p = math.pow(10, digits) | |
return int(x * p)/p |
#! /bin/bash | |
# Provisioning script for a mongo-backed go server on a vagrant box | |
echo "install basic requirements" | |
apt-get --quiet -y update | |
DEBIAN_FRONTEND=noninteractive apt-get --quiet -y upgrade | |
apt-get --quiet -y install build-essential mercurial git curl libssl-dev pkg-config tree mongodb bison make gcc binutils | |
# this is extra bash stuff to make things easier to manage | |
shopt -s histappend | |
HISTFILESIZE=2000 | |
HISTSIZE=1000 | |
export TERM=xterm-256color | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxCxDxBxegedabagacad |
################################################################# | |
# Here's a bunch of stuff to do prompts that are sensitive to git and svn | |
WHT='\e[22;37m' | |
TEAL='\e[22;36m' | |
BLK='\e[22;30m' | |
RED='\e[22;31m' | |
GRN='\e[22;32m' | |
YEL='\e[22;33m' | |
BLU='\e[22;34m' |
type Data struct { | |
Data []struct { | |
Data struct { | |
Stimulus string `json:"stimulus,omitempty"` | |
Template string `json:"template,omitempty"` | |
Type string `json:"type,omitempty"` | |
Validation struct { | |
ScoringType string `json:"scoring_type,omitempty"` | |
ValidResponse struct { | |
Score int `json:"score,omitempty"` |
// SanitizeHTML strips html tags, replace common entities | |
func SanitizeHTML(s string) string { | |
output := "" | |
// Shortcut strings with no tags in them | |
if !strings.ContainsAny(s, "<>") { | |
output = s | |
} else { |
// This file isn't really needed but I'm not ready to delete it yet. | |
package main | |
import ( | |
"bytes" | |
"crypto" | |
"crypto/rsa" | |
"crypto/sha256" | |
"encoding/base64" |