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
alias pr-prep=' | |
(time ( | |
echo "==> Fetching deps" && \ | |
time mix deps.get && \ | |
echo "==> Running mix format" && \ | |
time mix format && \ | |
echo "==> Checking if formatted" && \ | |
time mix format --check-formatted && \ | |
echo "==> Cleaning unused deps" && \ | |
time mix deps.clean --unlock --unused && \ |
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 'zip' | |
archive_directory_path = '' | |
archive_zip_path = '' | |
Zip::File.open(archive_zip_path, Zip::File::CREATE) do |zip_file| | |
Dir[File.join(archive_directory_path, "**", "**")].each do |file| | |
zip_file.add(file.sub("#{ archive_directory_path}/", ""), file) | |
end | |
end |
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
SELECT | |
students.last_name AS "Student Last Name", | |
students.first_name AS "Student First Name", | |
students.user_canvas_id AS "Student Canvas ID", | |
students.user_sis_id AS "Student SIS ID", | |
course_dim.name AS "Course Name", | |
course_dim.canvas_id AS "Course Canvas ID", | |
course_dim.sis_source_id AS "Course SIS ID", | |
course_section_dim.name AS "Section", | |
course_section_dim.canvas_id AS "Section Canvas ID", |
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
"bracket-pair-colorizer-2.colors": [ | |
"DeepSkyBlue", | |
"DodgerBlue", | |
"MediumSlateBlue", | |
"BlueViolet", | |
"MediumVioletRed", | |
"DeepPink", | |
"Red", | |
"DarkOrange", | |
"Gold", |
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
SELECT | |
table_schema, | |
table_name, | |
(xpath('/row/cnt/text()', xml_count))[1]::text::int AS row_count | |
FROM ( | |
SELECT | |
table_name, | |
table_schema, | |
query_to_xml(format('select count(*) as cnt from %I.%I', table_schema, table_name), FALSE, TRUE, '') AS xml_count | |
FROM |
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
-- Mixed with CASE, this will extract the float/digits in the last set of `()` in the string | |
CASE WHEN string_to_chop LIKE '%(%-%)%' THEN | |
NULL | |
ELSE | |
NULLIF (REPLACE(REPLACE(REGEXP_SUBSTR (string_to_chop, '\\([[:digit:]]+.[[:digit:]]+\\)$|\\([[:digit:]]+\\)$'), '(', ''), ')', ''), '')::float | |
END AS chopped_string |
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
find . -mindepth 2 -type f -print -exec mv {} . \; |
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 'progress_bar' | |
# Extends CSV class to include progress bar enhancement | |
class CSV | |
module ProgressBar | |
def progress_bar | |
::ProgressBar.new(@io.size, :bar, :counter, :percentage, :elapsed, :eta) | |
end | |
def each |