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
I was drawn to programming, science, technology and science fiction | |
ever since I was a little kid. I can't say it's because I wanted to | |
make the world a better place. Not really. I was simply drawn to it | |
because I was drawn to it. Writing programs was fun. Figuring out how | |
nature works was fascinating. Science fiction felt like a grand | |
adventure. | |
Then I started a software company and poured every ounce of energy | |
into it. It failed. That hurt, but that part is ok. I made a lot of | |
mistakes and learned from them. This experience made me much, much |
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
#!/bin/bash | |
# Exit on error or unset variable. | |
set -e | |
set -u | |
source .env | |
# TODO: Find a builtin way to do this. | |
function urldecode() { |
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
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work. | |
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0." | |
Database files have to be updated before starting the server, here are the steps that had to be followed: | |
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default | |
brew unlink postgresql | |
brew install [email protected] | |
brew unlink [email protected] | |
brew link postgresql |
NewerOlder