# Rakefile
require_relative 'lib/task_helpers'
namespace :reset do
desc 'Clean logs'
task :logs do
FileUtils.rm_rf 'log/'
end
This file contains hidden or 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
// XPath CheatSheet | |
// To test XPath in your Chrome Debugger: $x('/html/body') | |
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/ | |
// 0. XPath Examples. | |
// More: http://xpath.alephzarro.com/content/cheatsheet.html | |
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class |
This file contains hidden or 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
###################### | |
####### DOCKER ####### | |
###################### | |
# Purpose: Delete all containers and images related to the provided tag name | |
# Example: `docker-nuke selenium` will delete all containers and images related to "selenium" | |
function docker-nuke { | |
args=("$@") | |
docker ps -a | grep ${args[0]} | cut -d ' ' -f 1 | while read ID; do docker rm $ID; done; | |
docker images | grep ${args[0]} | tr -s " " | cut -d ' ' -f 3 | while read ID; do docker rmi $ID; done |
This file contains hidden or 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
function prompt { # from http://dobsondev.com/customizing-your-terminal/ | |
local BLACK="\[\033[0;30m\]" | |
local BLACKBOLD="\[\033[1;30m\]" | |
local RED="\[\033[0;31m\]" | |
local REDBOLD="\[\033[1;31m\]" | |
local GREEN="\[\033[0;32m\]" | |
local GREENBOLD="\[\033[1;32m\]" | |
local YELLOW="\[\033[0;33m\]" | |
local YELLOWBOLD="\[\033[1;33m\]" | |
local BLUE="\[\033[0;34m\]" |
This file contains hidden or 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 'spec/factories/course_factory' | |
require 'spec/factories/user_factory' | |
# Create, register, and enroll teacher | |
course_with_teacher( | |
active_course: 1, | |
active_enrollment: 1, | |
course_name: 'E2E Course', | |
name: 'Teacher 1' | |
) |
This file contains hidden or 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
mv /opt/homebrew-cask/Caskroom /usr/local | |
brew cask install --force $(brew cask list) |
This file contains hidden or 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
# verified against log_in.feature for blake | |
# https://github.com/jnicklas/capybara/issues/1443 | |
# turn on webkit driver debug | |
$use_webkit = true | |
$use_chrome_instead_of_firefox = false | |
$webkit_debug = false | |
$wait_time = 5 | |
def webkit_driver | |
if $webkit_debug |
This file contains hidden or 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
# Purpose: Remove all non-running images and containers | |
# Use `docker-cleanup --dry-run` to see what would be deleted. | |
function docker-cleanup { | |
EXITED=$(docker ps -q -f status=exited) | |
DANGLING=$(docker images -q -f "dangling=true") | |
if [ "$1" == "--dry-run" ]; then | |
echo "==> Would stop containers:" | |
echo $EXITED | |
echo "==> And images:" |
This file contains hidden or 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
COURSES | |
* indicates full coverage | |
** indicates partial coverage | |
Course 1** | |
- active | |
-- past start date | |
-- no end date | |
- unrestricted |
This file contains hidden or 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
FROM ruby:latest | |
USER root | |
ENV APP_HOME /usr/src/app | |
RUN mkdir -p $APP_HOME | |
WORKDIR $APP_HOME | |
RUN apt-get update && apt-get install -y \ | |
netcat-openbsd |