Skip to content

Instantly share code, notes, and snippets.

View gregblake's full-sized avatar
👨‍💻

Greg Blake gregblake

👨‍💻
View GitHub Profile
@gregblake
gregblake / build_failure.sh
Created August 28, 2019 14:48
Task :app:processDebugManifest FAILED
> Task :app:processDebugManifest FAILED
/Users/greg/code/connect-rn/android/app/src/debug/AndroidManifest.xml:19:17-55 Error:
Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/filepaths) from [:react-native-image-picker] AndroidManifest.xml:19:17-55
is also present at [:rn-fetch-blob] AndroidManifest.xml:43:17-55 value=(@xml/provider_paths).
Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml to override.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
FAILURE: Build failed with an exception.
@gregblake
gregblake / rpush_certs.rb
Created August 27, 2019 14:26
Testing Rpush Certs
Rpush.embed # to deliver push notifications in the Rails console on notification save
# Selecting the mobile device that'll receive the notification:
greg = User.find_by(login: "greg.blake");
devices = greg.mobile_devices;
mobile_device = greg.mobile_devices.last;
# Sending a notification to the device
n = Rpush::Apns2::Notification.new;
n.app = mobile_device.app;
@gregblake
gregblake / rn_upgrade.md
Last active August 20, 2019 20:07
React Native Upgrade Issues

unable to lookup item 'Path' in SDK 'iphoneos'

Error after running make cocoapods:

xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'
/Users/greg/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-e8acf/missing: Unknown `--is-lightweight' option
@gregblake
gregblake / standup_7_31_19.md
Last active July 31, 2019 13:33
Standup Update
@gregblake
gregblake / after_pr_11607.sql
Created June 18, 2019 21:31
After PR #11607
-- ~14 queries
Connect::Room Load (1.0ms) SELECT `connect_rooms`.* FROM `connect_rooms` WHERE `connect_rooms`.`id` = 1976 LIMIT 1
Connect::RoomMembership Load (1.1ms) SELECT `connect_room_memberships`.* FROM `connect_room_memberships` WHERE `connect_room_memberships`.`connect_room_id` = 1976
(4.4ms) select user_id, connect_room_id, connect_bookmark_id, broadcaster from connect_room_users where 1=1 and connect_room_id in (1976) UNION ALL select null, id, null, 0 from connect_rooms where private=0 and archived=0 and id not in (select connect_room_id from connect_room_users)
SQL (1.4ms) SELECT DISTINCT `connect_messages`.`id`, connect_messages.created_at AS alias_0 FROM `connect_messages` LEFT OUTER JOIN `connect_message_reactions` ON `connect_message_reactions`.`connect_message_id` = `connect_messages`.`id` LEFT OUTER JOIN `connect_message_shared_files` ON `connect_message_shared_files`.`connect_message_id` = `connect_messages`.`id` LEFT OUTER JOIN `connect_message_mentions` ON `connect_message_mentions
@gregblake
gregblake / before_pr_11607.sql
Created June 18, 2019 21:30
Before PR #11607
-- ~264 queries
(4.8ms) select user_id, connect_room_id, connect_bookmark_id, broadcaster from connect_room_users where 1=1 and (user_id = 31995) UNION ALL select null, id, null, 0 from connect_rooms where private=0 and archived=0 and id not in (select bookmarkable_id from connect_bookmarks where bookmarkable_type='Connect::Room' and user_id=31995)
(2.7ms) SELECT `connect_rooms`.`id` FROM `connect_rooms` WHERE `connect_rooms`.`id` IN (64, 121, 138, 157, 164, 193, 202, 308, 326, 590, 1301, 1341, 1511, 1681, 1976, 2216, 2686, 3096, 3316, 3536, 3617, 3622, 3662, 4975, 5005, 5030, 5223, 5498, 5508, 5568, 5903, 6913, 6998, 7138, 7713, 7803, 8458, 8533, 8563, 8598, 8763, 8923, 9023, 9028, 9033, 9513, 9748, 9813, 9948, 9953, 9958, 9963, 9968, 9973, 9978, 9983, 10253, 10278, 10373, 10606, 10611, 10643, 10648, 10652, 10657, 10663, 10668, 10733, 10783, 10892, 10962, 11083, 11208, 11213, 11217, 11232, 11233, 11242, 11358, 11362, 11423, 11427, 11432, 11483, 11487, 11497, 11503, 11507, 11512, 11513, 11602, 11638,
@gregblake
gregblake / marketing_teams.md
Last active June 18, 2019 14:00
Marketing Teams Handoff

Marketing Teams

Date Range Issue

I believe this is a result of the team member's start and end dates being blank, on teams and users that were added to Nitro before this year's Create. When you edit a team on the web, the users' dates don't appear to be blank, but they are blank in the database.

Sentry Exception

[9] pry(main)&gt; Time.now.between?(nil, Date.tomorrow)
@gregblake
gregblake / rails_console.rb
Created June 11, 2019 14:32
Rails Console Code Used to Test Query Optimizations in PR 11524
[12] pry(main)> room = Connect::Room.find(24259);
Connect::Room Load (1.6ms) SELECT `connect_rooms`.* FROM `connect_rooms` WHERE `connect_rooms`.`id` = 24259 LIMIT 1
[13] pry(main)> room.name
=> "Alex’s Month - Care To Smile - June 02-30 - Alex's Global Chat"
[14] pry(main)> room.users.count;
=> 2636
[15] pry(main)> MobileDevice.count
(1.5ms) SELECT COUNT(*) FROM `mobile_devices`
=> 0
[16] pry(main)> room.users.each do |user|
@gregblake
gregblake / date_validation_bug_fix_pr.md
Last active June 5, 2019 16:41
Date Validation Bug Fixes
  • Resolves an issue where validation errors would be applied incorrectly if the user's date range matched the team's date range. Here are the steps to recreate this issue in production:

    1. Create a team with the default dates, and a mentor.
    2. Add a team member with the default dates. It's possible to update the team.
    3. Click save a second time. It's not possible to update the team, because of the "must accommodate the date range" validation errors being applied incorrectly.
  • Resolves an issue when the user's dates overlapped with the team's dates. Here are the steps to recreate this issue in production:

    1. Create a team with the default dates.
  1. Add a team member with the default dates.
@gregblake
gregblake / bash_profile
Created May 29, 2019 13:21
Add nvm to ~/.bash_profile
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm