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
# adds aliases and imports a / some module(s) to iex shell for liquidvoiting API | |
# rename to .iex.exs and place in API project root | |
# for dev environment, not production - add to / don't remove from your local gitignore | |
# <alias ... as> used to avoid referencing other module with name equivalent to alias | |
import Ecto.Query | |
alias LiquidVoting.Application, as: App | |
alias LiquidVoting.{ | |
Delegations, |
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
# adds aliases and imports a / some module(s) to iex shell for liquidvoiting AUTH | |
# rename to .iex.exs and place in AUTH project root | |
# for dev environment, not production - add to / don't remove from your local gitignore | |
# <alias ... as> used to avoid referencing other module with name equivalent to alias | |
import Ecto.Query | |
alias LiquidVotingAuth.Application, as: App | |
alias LiquidVotingAuth.{ | |
Organizations, |
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 | |
tput init | |
echo Testing locally, on http://localhost:4000 ... | |
echo | |
response1=$(curl -X POST http://localhost:4000 -H "Content-Type: application/json" -H "Org-UUID: b7a9cae5-6e3a-48b1-8730-8b5c8d6c9b5a" -d '{ "query": "mutation { createDelegation(proposalUrl: \"https://github.com/user/repo/pulls/15\", delegatorEmail: \"[email protected]\", delegateEmail: \"[email protected]\") { delegator { email } delegate { email } proposalUrl }}" }') | |
pass1=$(echo "$response1" | grep -o '{"data":{"createDelegation":{"delegate":{"email":"[email protected]"},"delegator":{"email":"[email protected]"},"proposalUrl":"https://github.com/user/repo/pulls/15"}}}') | |
fail1=$(echo "$response1" | grep -o '"message":"Could not create delegation"') |
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/zsh | |
# Zsh script to run rspec full test suite repeatedly (and in random orders). | |
# For overnight testing. Just 'Ctrl-C' repeatedly to terminate. | |
# Logs each full run to a separate log file. | |
# Interpolating date-time in filename avoids overwriting file with same name. | |
# Note: Make sure your computer will not sleep / hibernate in middle of process. | |
repeat 100 { | |
# Sleep gives time to Ctrl-C repeatedly before new file is created. |
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
# Print summary of test failures and write to file. | |
# Intended to work with log files generated by log_rand_specs.zsh | |
# https://gist.github.com/jinjagit/1607b817df5dbaa5d443ea1a9a60938c | |
errors = {} | |
read_failures = false | |
n = 0 | |
def record_errors(line, errors) | |
unless line.include?("Failed examples:") || line.include?("Randomized with seed") || line.chomp.empty? |
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
# Strips single quotes from a file, line by line. | |
# Useful template for other sanitization needs. | |
lines =[] | |
File.readlines('some_file.csv').each do |line| | |
lines << line | |
end | |
File.open("some_file.csv", "w") { |f| |
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
# frozen_string_literal: true | |
namespace :fix_existing_tenants do | |
desc 'Update text_images if referenced in HomePage.bottom_info_section_multiloc' | |
# Usage: | |
# Dry run (no changes): rake fix_existing_tenants:update_home_page_text_images | |
# Execute (changes): rake fix_existing_tenants:update_home_page_text_images['execute'] | |
task :update_home_page_text_images, [:execute] => [:environment] do |_t, args| | |
args.with_defaults(execute: false) |