Skip to content

Instantly share code, notes, and snippets.

View wndxlori's full-sized avatar

Lori M Olson wndxlori

View GitHub Profile
@wndxlori
wndxlori / well_cluster_annotation_view.rb
Created May 13, 2019 17:36
Custom MapKit Annotation View in RubyMotion
class WellClusterAnnotationView < MKAnnotationView
attr_accessor :count
attr_accessor :count_label
def initWithAnnotation(annotation, reuseIdentifier:identifier)
super.tap do |view|
view.backgroundColor = UIColor.clearColor
view.setup_label
view.count = annotation.annotations.count
@wndxlori
wndxlori / drgtk_stack_trace.rb
Created August 7, 2019 15:12
Stack tracing for DragonRuby
module Spy
def self.on! instance
all_methods = instance.class.instance_methods false
instance.class.class_eval do
attr_accessor :__spy_call_depth__ unless instance.class.instance_methods.include?(:__spy_call_depth__)
all_methods.reject { |m| m.start_with? "__spy_" }.each do |m|
original_method_name = m
new_method_name = "__spy_original_#{m}__".to_sym
alias_method new_method_name, m
puts "Spying on! #{m}"

Use match.

Create private git repo to synchronize certs and profiles

Add gem 'fastlane' to the Gemfile in your RubyMotion project directory

Run bundle exec fastlane match init in your RubyMotion project directory

be fastlane match init
@wndxlori
wndxlori / send_to_kindle.rb
Last active April 15, 2024 20:00
When you have a whole LOT of ebooks to send to your Kindle
#!/Usr/bin/env ruby
require 'mail'
require 'fileutils'
# Check if a command line argument is provided
if ARGV.length < 1
puts "Usage: ruby send_to-kindle.rb <directory containing epub files>"
exit 1