You can see the various files added in this gist to really do the bulk of the work.
The important bits seem to be:
yarn add esbuild-sass-plugin
#Pretend the sum is a big decimal and we want to conditionally append a 0 to replace | |
#the second dec place because ruby can chop the sec dec point | |
sum = "540.2" | |
def dec_split_sum(sum) | |
# Convert Sum to a string and then split it at the decimal point. | |
sum = sum.to_s.split('.') | |
if sum[1].length == 1 | |
puts sum[0] + '.' + sum[1] + '0' | |
else |
# Given this array of Animals, | |
array = ['cow', 'sheep', 'sheep', 'pig', 'tiger', 'pig', 'lion', 'bear', 'cat'] | |
# We can be sure we return only the unique values | |
animals = array.uniq | |
# Let's loop through and print them out | |
animals.each do |animal| | |
puts animal | |
end |
#!/bin/bash | |
cd /home/minecraft/server/ | |
screen -dmS minecraft java -Xmx1G -Xms1G -jar minecraft |
function gitwork() { | |
local author="${1:-@me}" | |
local daysAgo="${2:-7}" | |
gh pr list -A $author -L 50 -S "merged:>=$(date -v-$daysAgo\d +%Y-%m-%d)" --json title,url,mergedAt > prs.json && ruby -e 'require "json"; prs = JSON.parse(File.read("prs.json")); prs.map { |pr| puts "<a href=\"#{pr["url"]}\">#{pr["title"]}</a><br>" }' | textutil -stdin -format html -convert rtf -stdout | pbcopy && rm prs.json | |
echo "Copied list of PRs to clipboard" | |
} |