Skip to content

Instantly share code, notes, and snippets.

View ngocbv's full-sized avatar
🏠
Working from home

ngocbv ngocbv

🏠
Working from home
View GitHub Profile
@ngocbv
ngocbv / debugger pause beforeunload
Created August 10, 2020 00:49 — forked from carcinocron/debugger pause beforeunload
Chrome: pause before redirect
// Run this in the F12 javascript console in chrome
// if a redirect happens, the page will pause
// this helps because chrome's network tab's
// "preserve log" seems to technically preserve the log
// but you can't actually LOOK at it...
// also the "replay xhr" feature does not work after reload
// even if you "preserve log".
window.addEventListener("beforeunload", function() { debugger; }, false)
class CustomSet
attr_reader :data
def initialize(init_data)
@data = init_data
end
def exist?(element)
@data.each do |record|
if element == record