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: clone_all_repos.sh [organization] <output directory> | |
ORG=$1 | |
PER_PAGE=100 | |
GIT_OUTPUT_DIRECTORY=${2:-"/tmp/${ORG}_repos"} | |
if [ -z "$GITHUB_TOKEN" ]; then | |
# https://github.com/settings/tokens | |
echo -e "Variable GITHUB_TOKEN isn't set! Please specify your GitHub token.\n\nMore info: https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/" |
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
# | |
# Place this code to your .profile, .bashrc, .bash_profile or whatever | |
# | |
program_exists () { | |
type "$1" &> /dev/null ; | |
} | |
if program_exists go; then |
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
require "test/unit" | |
# Write a function called numPizzas, that takes the number of people present, | |
# the number of slices in a pizza, and the time of day, and returns the | |
# number of pizzas to buy (as a whole integer). | |
# | |
# Spec: | |
# Signature: int numPizzas(int numPeople, int slicesPerPizza, int time) | |
# Time is an int on 24-hour clock (0-23), e.g. 8 = 8am, 14 = 2pm | |
# 11 = 11am 11pm = 23 |