Skip to content

Instantly share code, notes, and snippets.

@kerlin
kerlin / get_workers.rb
Last active November 17, 2021 02:03
Calling the Workday API in Ruby with Savon
#!/usr/bin/env ruby
#
# Example Ruby CLI script to retrieve worker data from Workday
# Call on command line with worker id; prints worker name
# add "request" or "response" after worker id and prints the
# outgoing xml or received hash and exits.
#
# Using Savon version 2 for the SOAP client (2.11.2)
#
# Savon defaults to making the message tag the same as the operation name
@stevenharman
stevenharman / 00_Heroku-Release-Phase-Review-Apps-Rails_README.md
Last active May 23, 2024 04:43
Heroku Release Phase script for managing Rails DB migrations, and playing nice with Review Apps and postdeploy scripts

Heroku Release Phase + Review Apps + Rails

This is a simplified, but fairly thorough, set of scripts and configuration to enable Heroku Release Phase for Rails apps. Further, this particular set up plays nicely with Heroku Review Apps in that the release phase script will:

  1. Fail, loudly, if the DB does not yet exist.
  2. Load the DB schema if the current schema version (as determined by bin/rails db:version) is 0.
  3. Run DB migrations otherwise.

For a "normal" app that usually means it will run the DB migrations.

@korakot
korakot / selenium.py
Last active May 31, 2024 18:47
Use selenium in Colab
# install chromium, its driver, and selenium
!apt update
!apt install libu2f-udev libvulkan1
!wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
!dpkg -i google-chrome-stable_current_amd64.deb
!wget https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.70/linux64/chromedriver-linux64.zip
!unzip -j chromedriver-linux64.zip chromedriver-linux64/chromedriver -d /usr/local/bin/
!pip install selenium chromedriver_autoinstaller
# set options to be headless, ..
@leegonzales
leegonzales / ChatGPT-Writing Style Analyzer.txt
Last active February 3, 2023 03:34
ChatGPT Prompt: Writing Style Analyzer
Prompt Chaining -
Priming Prompt: “For today's task, you are going to be acting like a highly capable and skilled analyst with excellent attention to detail. You will be tasked with analyzing a writing sample and generating a list of instructions on how to mimic the writing style of the sample. This will require excellent analytical skills and the ability to identify and analyze a variety of writing style attributes, as well as strong language skills to communicate your instructions effectively. Overall, you will need to be highly capable and skilled at analyzing and mimicking writing styles in order to complete this task successfully.”
Tasking Prompt:
“Now - your task is to analyze a writing sample provided below inside {writing sample} and generate a list of instructions on how to mimic the writing style of the sample. These instructions will guide future writing so they must effectively convey the desired writing style, and should be written in affirmative language. Be sure to consider a variety of attrib