Skip to content

Instantly share code, notes, and snippets.

View wndxlori's full-sized avatar

Lori M Olson wndxlori

View GitHub Profile
@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

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 / 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}"
@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 / main.rb
Last active May 8, 2019 21:53
DragonRuby Game Toolkit Tutorial - Galaga clone...a new beginning
# the first 2 or 4 values of the primitive conventionally are x, y, (w, h, or x2, y2)
# the last 4 values conventionally are r, g, b, a (color)
# custom values for primitive are in the middle
# labels x, y, text, size, alignment, r, g, b, a
# sprites x, y, w, h, path, angle, alpha
# lines x, y, x1, y1, r, g, b, a
# solids x, y, w, h, r, g, b, a
# borders x, y, w, h, r, g, b, a
# sounds ".wav|.ogg"
@wndxlori
wndxlori / README.md
Last active November 6, 2018 00:32
Testing navigation bar buttons in RubyMotion

This is in answer to a question than came up in a course I am teaching. There do not appear to be any good examples of testing navigation bar button items, so I ran up this quick example. Two things of note:

  1. You need to explicitly call your controller's "on_load" or similar method that actually adds the UI items, in your before block if you actually want to test those items. In the case of the default Red Potion app, we create the nav bar buttons in HomeScreen.on_load, so we need to call that method in the before block of our spec, to ensure the nav buttons are present.

  2. The navigation bar is accessed from your UIViewController as navigationItem, and it is a UINavigationItem. You should check out the docs for these classes.

https://developer.apple.com/documentation/uikit/uiviewcontroller?language=objc https://developer.apple.com/documentation/uikit/uinavigationitem?language=objc

@wndxlori
wndxlori / test.yaml
Last active February 28, 2018 17:44
[stable/kong] Enables non-ssl deploys #3861
proxy:
useTLS: false
servicePort: 8001
containerPort: 8001
admin:
useTLS: false
servicePort: 8000
containerPort: 8000
readinessProbe:
httpGet:
@wndxlori
wndxlori / about.html
Created January 10, 2017 23:53
Example of displaying a lot of formatted text, styled using https://github.com/colinta/teacup
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>About</title>
<style>
p {color:#ff9400;}
h2 {color: #ffa428; text-align: center;}
</style>
</head>
@wndxlori
wndxlori / t_tweet_to_list
Created October 26, 2015 17:42
Tweet to list
t list members lethbridge-educators | while read handle ; do t update "@$handle Hoping you could help spread the word about girlslearningcodeday.com at your school? https://dl.dropboxusercontent.com/u/6823540/GLCDay.pdf" ; sleep 3 ; done
@wndxlori
wndxlori / btcdiversity-research.txt
Created September 21, 2015 03:54
BTC Panel links
Diversity Comparison
http://www.theverge.com/2015/8/20/9179853/tech-diversity-scorecard-apple-google-microsoft-facebook-intel-twitter-amazon
Most have 2 years of data now, but little qualitative analysis of year over year change. No follow throught on commitment
to goals for improvement.
Binary gender & ethnicity (no age). Basically the bare minimum as required by law.
http://www.google.com/diversity/
http://newsroom.fb.com/news/2015/06/driving-diversity-at-facebook/