This file contains hidden or 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
| Rails.application.eager_load! | |
| ActiveRecord::Base.descendants.each do |model| | |
| next unless model.table_exists? | |
| model.columns.each do |col| | |
| next unless col.name =~ /_?id\Z/ | |
| if col.type == :integer && col.sql_type != "bigint" | |
| puts "#{model.table_name} #{col.name} is of type #{col.sql_type} but should be bigint" |
This file contains hidden or 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 { Controller } from 'stimulus' | |
| export default class extends Controller { | |
| connect() { | |
| if ( typeof window.ga != 'undefined' ) { | |
| const currentExperiments = this.experiments() | |
| Object.keys(currentExperiments).forEach((experimentId) => { | |
| ga('set', 'expId', experimentId) |
This file contains hidden or 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
| VCR.configure do |config| | |
| config.cassette_library_dir = "test/support/vcr_cassettes" | |
| config.hook_into :webmock | |
| config.ignore_localhost = true | |
| end | |
| module RecordedVCR | |
| extend ActiveSupport::Concern | |
| included do |
This file contains hidden or 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 --disable-gems | |
| require "date" | |
| require "fileutils" | |
| JOURNAL_DIR = File.expand_path("~/textos/diario") | |
| now = DateTime.now | |
| date = now.strftime("%F") |
This file contains hidden or 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 "open-uri" | |
| module Imports | |
| class PageCrawler | |
| attr_reader :current_page, :pages, :crawled | |
| attr_accessor :follow_patterns, :ignore_patterns | |
| def initialize(start_url, max_depth: 3, max_pages: 1000) | |
| @max_depth, @max_pages = max_depth, max_pages |
This file contains hidden or 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 --disable-gems | |
| require "date" | |
| require "fileutils" | |
| JOURNAL_DIR = File.expand_path("~/Google Drive/writing/journal") | |
| now = DateTime.now | |
| date = now.strftime("%F") |
This file contains hidden or 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
| module main | |
| go 1.17 | |
| require github.com/gorilla/websocket v1.4.2 // indirect |
This file contains hidden or 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> | |
| <meta charset="utf-8"> | |
| <link rel="stylesheet" href="https://cdn.simplecss.org/simple.min.css"> | |
| <script> | |
| const STATES = [ | |
| "CONNECTING", | |
| "OPEN", | |
| "CLOSING", |
This file contains hidden or 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> | |
| <meta charset="utf-8"> | |
| <title>Slow document.body.cloneNode(true) in Chrome</title> | |
| <body> | |
| <div id="container"></div> | |
| <script type="text/javascript"> |
This file contains hidden or 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> | |
| <meta charset="utf-8"> | |
| <title>Stimulus Test</title> | |
| </head> | |
| <body> | |
| <div id="container"> | |
| <button id="cloneBodyBtn">Clone body</button> |