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
#!/usr/bin/env ruby | |
require "pathname" | |
common_ancestor_sha = `git merge-base HEAD origin/master`.strip | |
commit_messages = `git log --pretty=format:"%B" #{common_ancestor_sha}..HEAD` | |
if commit_messages.include?("[skip schema checks]") | |
puts "Found [skip schema checks] tag, skipping db migration check." | |
exit |
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
#!/usr/bin/env ruby | |
# adapted from https://gist.github.com/stevenharman/f5fece7fd39356e57ce3c710911f714f | |
RED = "\033[0;31m" | |
GREEN = "\033[0;32m" | |
NO_COLOR = "\033[0m" | |
if `command -v bundle exec rubocop` == "" | |
puts "💀#{RED} Install Rubocop and be sure it is available on your PATH#{NO_COLOR}" |
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
desc "Create a RuboCop rule using a template. You can use snake_case or CamelCase for the cop name; either way it will be converted to CamelCase." | |
task :generate_cop, [:name] do |_t, args| | |
require "active_support/inflector/methods" | |
camel_case_name = ActiveSupport::Inflector.camelize(args[:name], true) | |
snake_case_name = ActiveSupport::Inflector.underscore(camel_case_name) | |
cop_path = "lib/rubocop/cop/<company name>/#{snake_case_name}.rb" | |
spec_path = "spec/rubocop/cop/<company name>/#{snake_case_name}_spec.rb" | |
raise ArgumentError, "Cannot create cop -- file <#{cop_path}> already exists." if File.exist?(cop_path) | |
raise ArgumentError, "Cannot create spec -- file <#{spec_path}> already exists." if File.exist?(spec_path) |
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
set -e | |
bundle exec rake generate_cops_documentation | |
if [ -n "$(git status --porcelain)" ]; then | |
echo "rake generate_cops_documentation resulted in a dirty tree; you probably need to generate and check in documentation"; | |
git status | |
git --no-pager diff | |
exit 1 | |
fi |
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
patient_preferences = create( | |
:patient_preferences, | |
health_information_exchange_opt_in: true, | |
health_information_exchange_legal_text_version: 1 | |
) | |
patient_preferences.reload | |
# Add the following two lines | |
patient_preferences.health_information_exchange_opt_in_will_change! |
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
patient_preferences = create( | |
:patient_preferences, | |
health_information_exchange_opt_in: true, | |
health_information_exchange_legal_text_version: 1 | |
) | |
patient_preferences.health_information_exchange_opt_in = true | |
patient_preferences.health_information_exchange_legal_text_version = 2 | |
puts patient_preferences.changes |
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
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad | |
## ANSI color codes | |
RS="\[\033[0m\]" # reset | |
HC="\[\033[1m\]" # hicolor | |
UL="\[\033[4m\]" # underline | |
INV="\[\033[7m\]" # inverse background and foreground | |
FBLK="\[\033[30m\]" # foreground black | |
FRED="\[\033[31m\]" # foreground red |
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
adb shell | |
su | |
rm /data/misc/wifi/wpa_supplicant.conf |
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 'csv' | |
require 'json' | |
STUDENTS_CSV_PATH = 'students.csv' | |
TEACHERS_CSV_PATH = 'teachers.csv' | |
EMAIL_KEY = 'Email address' | |
LANGUAGE_KEY = 'What would you like to learn?' | |
EXPERIENCE_KEY = 'How experienced are you?' | |
TEACH_KEY = 'What do you want to teach?' |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Feedback</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | |
<style type="text/css"> | |
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); | |
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); | |
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic); |
NewerOlder