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
for (const elem of document.querySelectorAll('[type="email"],[placeholder*=email i],[aria-label*=email i]')) { | |
const prevName = elem.name; | |
const clone = elem.cloneNode(); | |
clone.name = 'email'; | |
elem.replaceWith(clone); | |
setTimeout(() => { clone.replaceWith(elem) }, 5000); | |
} |
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
// ==UserScript== | |
// @name Gmail Unsubscribe | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Unsubscribe by pressing \ | |
// @author Maros Hluska | |
// @homepage https://mhluska.com | |
// @match https://mail.google.com/* | |
// @icon https://www.google.com/s2/favicons?domain=tampermonkey.net | |
// @grant none |
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
const util = require('util') | |
norm_widget_1 = { | |
'foo': 1, | |
'bar': 'baz', | |
'_jv': { | |
'type': 'widget', | |
'id': '1', | |
'relationships': { | |
'widgets': { |
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
import Service, { inject as service } from '@ember/service'; | |
import { getOwner } from '@ember/application'; | |
import { computed } from '@ember/object'; | |
export default Service.extend({ | |
fastboot: service(), | |
init() { | |
this._elemCache = {}; | |
this._super(...arguments); |
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
import Service, { inject as service } from '@ember/service'; | |
import { computed } from '@ember/object'; | |
import { alias } from '@ember/object/computed'; | |
export default Service.extend({ | |
store: service(), | |
session: service(), | |
auth: alias('session.data.authenticated'), |
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 User < ApplicationRecord | |
has_many :order_items_bought, | |
-> { joins(:order).where.not(orders: { state: :expired }).order(created_at: :desc) }, | |
foreign_key: :buyer_id, | |
class_name: :OrderItem | |
has_many :videos_bought, | |
-> { joins(:orders).select('DISTINCT ON (videos.id) videos.*').reorder('videos.id DESC') }, | |
through: :order_items_bought, | |
source: :item, |
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
import Service, { inject as service } from '@ember/service'; | |
export default Service.extend({ | |
ajax: service(), | |
store: service(), | |
fastboot: service(), | |
client: null, | |
init() { |
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
# spec/rails_helper.rb | |
if ENV['SAVE_SCREENSHOTS'] | |
module CapybaraElementExtensions | |
INTERACTION_METHODS = %i[set select_option unselect_option click | |
right_click double_click send_keys hover trigger drag_to execute_script | |
evaluate_script evaluate_async_script] | |
INTERACTION_METHODS.each do |method| | |
define_method method do |*args, &block| |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Videos' | |
}); |
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
import Component from '@ember/component'; | |
import { computed } from '@ember/object'; | |
import { | |
noop, | |
} from 'lodash'; | |
export default Component.extend({ | |
tagName: 'video', | |
classNameBindings: ['isPlaying'], |
NewerOlder