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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
horse_names = [] | |
horse_finish_times = [] | |
def register_horse(horse_name, horse_number): | |
horse = [horse_number, horse_name] | |
horse_names.append(horse) | |
print("Registered horse") | |
def record_race_data(horse_number, finish_time): | |
horse = [horse_number, finish_time] |
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
// Allows us to use Scanner (which is for user input) | |
import java.util.*; | |
// Don't worry about why we need this. HorseTracker is the name of this program, | |
// which is why we used it here | |
class HorseTracker | |
{ | |
public static String[] getHorseData(int horseCount) |
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
#!/usr/local/bin/ruby -w | |
# There doesn't seem to be an easy way to download a gif from giphy.com from the url type | |
# that people tend to use when posting in forums | |
# Usage: | |
# ruby giphy_dl.py <giphy url> | |
require 'giphy' | |
require 'open-uri' |
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
class BookInPartJob < ActiveJob::Base | |
queue_as :default | |
def perform(ticket_number, message, all_parts_received, warranty_reference, vendor, title) | |
ticket = Api::Autotask::Ticket.find_by_ticket(ticket_number) | |
api_warranty_reference = ticket.warranty_reference.value | |
if api_warranty_reference.exclude? warranty_reference | |
ticket.warranty_reference = "#{ticket.warranty_reference.value} #{warranty_reference}".strip | |
end | |
if all_parts_received |
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
Failed to load secrets.rb | |
yarn install v1.12.3 | |
[1/4] Resolving packages... | |
success Already up-to-date. | |
Done in 0.04s. | |
I, [2020-06-05T17:52:37.376781 #20893] INFO -- : Writing /home/rails/workshop_tracker/public/assets/manifest-312e30e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.js | |
I, [2020-06-05T17:52:37.377462 #20893] INFO -- : Writing /home/rails/workshop_tracker/public/assets/manifest-312e30e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.js.gz | |
rails aborted! | |
NoMethodError: undefined method `+' for nil:NilClass | |
/home/rails/workshop_tracker/vendor/bundle/ruby/2.5.0/gems/sprockets-4.0.1/lib/sprockets/asset.rb:138:in `etag' |
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
import ApplicationController from './application_controller'; | |
import tippy from 'tippy.js'; | |
import 'tippy.js/dist/tippy.css'; | |
// Inspired by https://chrislabarge.com/posts/stimulus-popup/ | |
// NOTE: ApplicationController must have `this.element[this.identifier] = this;` in the connect() method. | |
/* | |
// Manually set content and trigger | |
// 'data-popup-trigger': :manual is optional. When no content is given, the controller isn't going to show a popup on mouseenter or click |