- Open Quicktime
- File > New Movie Recording
- View > Float on Top
- Resize and reposition camera view over slide as desired
- File > New Screen Recording
- From "record" button drop-down, ensure microphone is enabled
- Press record button
- Drag
- Start recording
- Advance slides as necessary
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
module Datadog | |
module Contrib | |
module Sidekiq | |
module Tracing | |
def job_resource(job) | |
if job['wrapped'] | |
job['wrapped'] | |
elsif job['class'] == 'Sidekiq::Extensions::DelayedClass' | |
YAML.load(job['args'].first)[0..1].join('.') rescue job['class'] # rubocop:disable Security/YAMLLoad | |
else |
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
# In most cases, script proceeds as expected: | |
$ ruby script.rb | |
................................................................................ done. | |
$ ruby script.rb | |
................................................................................ done. | |
# Occasionally, fails with empty results: | |
$ ruby script.rb | |
........script.rb:59:in `block (3 levels) in <main>': got a nil widget (RuntimeError) |
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
> "Báe".length | |
=> 4 | |
> "Báe".encoding | |
=> #<Encoding:UTF-8> | |
> "Báe".encode('utf-8', 'utf-8-mac').encoding | |
=> #<Encoding:UTF-8> | |
> "Báe".encode('utf-8', 'utf-8-mac').length | |
=> 3 |
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
# In gravity Rails console, for example. | |
url = app.reset_password_url(a: 'b', c: 'd') | |
# => "http://www.example.com/reset_password?a=b&c=d" | |
url.html_safe? | |
# => false | |
ERB::Util.h(url) # explicitly call the h() helper that's implicitly called by <%= ... %> | |
# => "http://www.example.com/reset_password?a=b&c=d" | |
view = ActionView::Base.new('app/views', {}, ActionController::Base.new) | |
# => #<ActionView::Base:0x000000110c5a60 ...> | |
view.render(inline: "<html><body><%= url %></body></html>", locals: {url: url}) # encode implicitly |
I hereby claim:
- I am joeyaghion on github.
- I am joeya (https://keybase.io/joeya) on keybase.
- I have a public key whose fingerprint is 7388 6671 6CF0 51A2 97BE 5D80 E61F 207F EE3F 0C11
To claim this, I am signing this object:
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
# apps in the *first* section of heroku apps output (i.e., apps that I own) | |
apps=( `heroku apps | sed -e '/^$/,$d' | grep -v '^=='` ) | |
# for each app that I own, show associated domains | |
for (( i = 0 ; i < ${#apps[@]} ; i++ )) | |
do | |
echo `heroku domains --app ${apps[$i]}` | |
done |
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/bin/env ruby | |
# Adapted from https://gist.github.com/hanloong/9849098 | |
require 'english' | |
require 'rubocop' | |
ADDED_OR_MODIFIED = /A|AM|^M/.freeze | |
changed_files = `git status --porcelain`.split(/\n/) |
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 ImportBase | |
include Mongoid::Document | |
include Mongoid::Timestamps | |
field :import_version, type: String, default: 'v1' # legacy imports use 'v1' connection | |
before_create do | |
self.import_version = 'v2' # new imports use 'v2' connection | |
end |
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
# Number of queued jobs per queue and priority | |
pp Delayed::Job.distinct(:queue).sort.map{|q| Delayed::Job.where(queue: q).distinct(:priority).sort.map{|p| [q, p, Delayed::Job.where(queue: q, priority: p).count] } }.sort; nil | |
# [[["any", 2, 3], ["any", 3, 3323], ["any", 4, 5542], ["any", 5, 2]], | |
# [["bidding", 3, 15]], | |
# [["default", 3, 10]], | |
# [["fair", 3, 246]]] | |
# First 20 jobs, in order that workers dequeue them | |
pp Delayed::Job.where(:run_at.lte => Time.now.utc, failed_at: nil).any_of({locked_by: /worker/}, {locked_at: nil}, {locked_at: {'$lt' => (Time.now.utc - 14400)}}).any_in(queue: %w{any imgs}).desc(:locked_by).asc(:priority).asc(:run_at).limit(20).map{|j| [j.id, j.handler.inspect[0..250], j.locked_by, j.run_at, (Time.now.utc - j.locked_at if j.locked_at)] }; nil | |
# [[<BSON::ObjectId:0x135554220 data=5629067d7261696db2000040>, |
NewerOlder