Skip to content

Instantly share code, notes, and snippets.

View Alex-Swann's full-sized avatar

Alex Swann Alex-Swann

  • London
View GitHub Profile
@Alex-Swann
Alex-Swann / ccms_payload_attribute_finder.rb
Created November 26, 2020 15:26 — forked from stephenrichards/ccms_payload_attribute_finder.rb
Print a list of all attributes in the CCMS payload
module CCMS
class PayloadParser
def initialize
@doc = File.open(Rails.root.join('ccms_integration/example_payloads/PassportedSingleProceedingNonMolDelegated.xml')) { |f| Nokogiri::XML(f).remove_namespaces! }
end
def run
puts ">>>>>>>>> #{__FILE__}:#{__LINE__} <<<<<<<<<<\n"
x = @doc.xpath('//Attributes//Attribute//Attribute')
@Alex-Swann
Alex-Swann / fix_exfat_drive.md
Created June 14, 2018 19:13 — forked from scottopell/fix_exfat_drive.md
Fix corrupted exFAT disk macOS/OSX

exFAT support on macOS seems to have some bugs because my external drives with exFAT formatting will randomly get corrupted.

Disk Utility is unable to repair this at first, but the fix is this:

  1. Use diskutil list to find the right drive id.
  2. You want the id under the IDENTIFIER column, it should look like disk1s1
  3. Run sudo fsck_exfat -d <id from above>. eg sudo fsck_exfat -d disk1s3
  4. -d is debug so you'll see all your files output as they're processed.
  5. Answer YES if it gives you the prompt Main boot region needs to be updated. Yes/No?
@Alex-Swann
Alex-Swann / morse_code_dictionary.rb
Created March 10, 2016 10:28 — forked from mikedamage/morse_code_dictionary.rb
Morse code dictionary as a Ruby Hash object
morse_dict = Hash.new({
"a" => ".-",
"b" => "-...",
"c" => "-.-.",
"d" => "-..",
"e" => ".",
"f" => "..-.",
"g" => "--.",
"h" => "....",
"i" => "..",