Skip to content

Instantly share code, notes, and snippets.

View jpr5's full-sized avatar
💭
committing badassery

Jordan Ritter jpr5

💭
committing badassery
View GitHub Profile
@jpr5
jpr5 / gist:822d93c7bfa73856292411bb12292adc
Created September 3, 2021 16:52
macOS URLs to invoke specific Settings panes
Accessibility Preference Pane
Main x-apple.systempreferences:com.apple.preference.universalaccess
Display x-apple.systempreferences:com.apple.preference.universalaccess?Seeing_Display
Zoom x-apple.systempreferences:com.apple.preference.universalaccess?Seeing_Zoom
VoiceOver x-apple.systempreferences:com.apple.preference.universalaccess?Seeing_VoiceOver
Descriptions x-apple.systempreferences:com.apple.preference.universalaccess?Media_Descriptions
Captions x-apple.systempreferences:com.apple.preference.universalaccess?Captioning
Audio x-apple.systempreferences:com.apple.preference.universalaccess?Hearing
Keyboard x-apple.systempreferences:com.apple.preference.universalaccess?Keyboard
Mouse & Trackpad x-apple.systempreferences:com.apple.preference.universalaccess?Mouse
@jpr5
jpr5 / jitsi-aws-graviton2-aarch64-instructions.txt
Last active November 8, 2022 16:01
JITSI on ARM64 (Amazon Graviton2 / aarch64)
JITSI et al. uses Java but there's no escaping a CPU-arch specific library for *coding video. You get the x86 one by default,
so it needs to be recompiled.
Seen lots of instructions out there that look complicated and are longer, change a bunch of extra settings, etc.
For AWS ARM64, much of that cruft is not needed. This is pretty simple.
As of 7/2/21, these are the *default* instructions for installing JITSI (Ubuntu LTS 20.04):
----
sudo -s # be root
@jpr5
jpr5 / b00m.rb
Created December 11, 2012 17:58
Nuke HipChat 1:1 History
require 'rubygems'
require 'mechanize'
account = {
:email => "jpr5@serv.io",
:password => "balls",
}
agent = Mechanize.new
site = agent.post("https://www.hipchat.com/sign_in", account).uri.host
@jpr5
jpr5 / bug.rb
Created October 16, 2012 20:28
Demo and workaround for post-connection delay bug in EventMachine 1.0.0
#!/usr/bin/env ruby
#
# Demo and workaround for post-connection delay bug in EventMachine 1.0.0
#
# See https://github.com/eventmachine/eventmachine/issues/374 for explanation.
require 'rubygems'
require 'eventmachine' # 1.0.0
require 'amqp' # 0.8.0 / 54f18d426
@jpr5
jpr5 / bot.rb
Created April 26, 2011 07:13
XMPP/Ruby Bot for HipChat
#!/usr/bin/env ruby
#
# Script: HipChat bot in Ruby
# Author: Jordan Ritter <jpr5@darkridge.com>
#
unless `rvm-prompt i g`.chomp == "ree@xmpp"
exec("rvm ree@xmpp ruby #{$0}")
end
@jpr5
jpr5 / 1_script.rb
Created February 25, 2011 20:28
DM: lazy-loaded properties materialized in hooks (:save) reset parental reference updates for children
#!/usr/bin/ruby
require 'rubygems'
require 'data_objects' # current master @ ed1ceefc
require 'dm-core' # current master @ 73860575
require 'dm-migrations' # current master @ ab608e81
class Order
include ::DataMapper::Resource
@jpr5
jpr5 / 1_bar.rb
Created February 9, 2011 05:59
bad bug in DM/DO nested transactions (FIXED in 03ae081f28a6143478e2174ccf3bd233e82cb91b)
#!/usr/bin/ruby
[
'addressable.git', 'extlib.git',
'do.git/data_objects', 'do.git/do_mysql',
'dm-core.git', 'dm-migrations.git', 'dm-transactions.git', 'dm-do-adapter.git', 'dm-mysql-adapter-1.0.0',
].each do |path|
$:.unshift "common/gems/#{path}/lib"
end
@jpr5
jpr5 / 1_no_workie.rb
Created January 17, 2011 20:52
[ruby 1.8.7] nested namespaces need physical nesting for const_missing? to work
#!/usr/bin/ruby
class Balls
BALLS = 1
end
class Balls::Dongs
def doit
puts "balls = #{BALLS}"
end
@jpr5
jpr5 / 1_example.rb
Created January 5, 2011 00:27
DM example of M:M through join table using two relationships.
class DocumentSet
include ::DataMapper::Resource
property :id, Serial
# First, define the immediate (intermediate) relationship.
has n, :document_maps, :child_key => [:ds_id]
# Then make another relationship that bounces through that relationship
# (:through), arriving at model Document.
@jpr5
jpr5 / 1_notes.txt
Created December 17, 2010 22:10
Nested-Transactional Cukes in DataMapper
Depends on:
- https://github.com/datamapper/do/commit/74645c46ac9b210c5e4029853b8a23fe02defd71
- https://github.com/datamapper/dm-transactions/commit/242e60473a341a151df62ea707264f06f418b077