- Make a new Automator document of type "App"
- Add these three steps in order
- Remember to replace
mikker
with your own username in the AppleScript scripts
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
<!doctype html> | |
<html> | |
<head> | |
<script> | |
window.BUCKET_OPTIONS = <%= bucket_options.to_json.html_safe %> | |
</script> | |
<%= javascript_include_tag :application %> | |
</head> | |
<body> | |
<!-- ... --> |
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
# app/models/stripe_events/account_updated.rb | |
module StripeEvents | |
class AccountUpdated | |
def call(event) | |
# do your thing | |
Rails.logger.debug(event.data.object) | |
end | |
end | |
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
#!/usr/bin/env ruby | |
class SlimLine | |
KNOWN_TAGS = "div|header|footer|aside|section|article|nav|main|ul|ol|li|a|p|h1|h2|h3|h4|h5|h6|span|button|form|input|textarea|select|option|label|fieldset|legend|table|thead|tbody|tr|td|th" | |
RE = %r{^(?<whitespace>\s*)(?<tag>(#{KNOWN_TAGS})\b)?(?<id>#[a-z\-]+)?(?<class_list>(\.[-a-z][a-z0-9\-:\/]*)+)?(?<rest>.*)?} | |
def initialize(line) | |
@line = line.dup | |
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
{ | |
"always_run_in_app" : false, | |
"icon" : { | |
"color" : "deep-purple", | |
"glyph" : "magic" | |
}, | |
"name" : "Add to Newsletters", | |
"script" : "const input = args.plainTexts[0] || \"[email protected]\";\nconst emails = input.match(\/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9._-]+)\/gi);\nconst email = emails[0];\n\n\nconst containers = await ContactsContainer.all();\n\nlet container, group;\nfor (const c of containers) {\n const groups = await ContactsGroup.all([c]);\n const newsletters = groups.find(g => g.name === \"Newsletters\");\n if (!newsletters) continue;\n container = c;\n group = newsletters;\n}\n\nconst contact = new Contact();\ncontact.emailAddresses =[{ value: email }];\nContact.add(contact, container.identifier);\ngroup.addMember(contact);\n\nawait Contact.persistChanges();\n\nconst alert = new Alert();\nalert.title = email;\nalert.addAction(\"OK\")\nalert.present();\n\n", | |
"share_sheet_inputs" : [ | |
"plain-text" |
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
require_relative "sheet.rb" | |
require 'digest' | |
CURRENT_BLOCK = 12345 | |
COMMUNITY_REACTIONS = 54321 | |
def main | |
sheet = Sheet.new('Metadata/InvisibleFriends_Metadata.csv') | |
sheet.headers.concat(['Seed', 'Filename', 'SHA256']) |
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
#!/bin/bash | |
# Usage: | |
# $ ensure_docker_is_ready && docker-compose up | |
docker ps &> /dev/null | |
if [ $? -ne 0 ]; then | |
open -a Docker.app | |
else | |
exit 0 |
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
require 'system_helper' | |
RSpec.describe 'Something', type: :system do | |
it 'receives an event', :with_stripe_events do | |
make_request_at_stripe | |
wait_for_stripe_event { |e| e.type == 'charge.succeeded' } | |
expect(...) | |
end | |
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
# Require this in config/application.rb after require "action_controller/railtie" | |
module ActionController | |
module Renderers | |
remove :json | |
remove :js | |
remove :xml | |
add :json do |json, options| | |
json = json.to_json(options) unless json.kind_of?(String) |
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
function main() { | |
console.log("tick"); | |
// Find the header signifying current timeline mode | |
const title = document.querySelector( | |
'[data-testid="primaryColumn"] h2[role="heading"]' | |
); | |
// If it isn't loaded yet, try again in 0.5 secs | |
if (!title) { |
NewerOlder