CPU
- AMD Ryzen 9 7900X AM5, 4.70 GHz, 12-Core
RAM
- Corsair 6000-40 Vengeance 2 x 32GB 6000 MHz (DDR5)
Nvme
- WD Black SN850X 4 TB M.2 2280
'use strict'; | |
const puppeteer = require('puppeteer'); | |
(async () => { | |
/* PRECONDITION: | |
0. download ublock, I used https://github.com/gorhill/uBlock/releases/download/1.14.19b5/uBlock0.chromium.zip | |
1. run $PATH_TO_CHROME --user-data-dir=/some/empty/directory --load-extension=/location/of/ublock | |
2. enable block lists you want to use | |
*/ |
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
This gist applies the theory from Ilya Grigorik's Script-injected "async scripts" considered harmful on the default Universal Analytics snippet. TLDR place this above the CSS in the <head>
of your document
<!-- Google Analytics Part 1: Creates window.ga, sets account, and queues pageview-->
<script>
!function(n,t){n.GoogleAnalyticsObject=t,n[t]=n[t]||function(){(n[t].q=n[t].q||[]).push(arguments)},n[t].l=1*new Date}(window,"ga");
ga('create', 'UA-XXXX-Y', 'auto'); // REPLACE UA-XXXX-Y w/ YOUR ACCOUNT
ga('send', 'pageview');
require 'rom-sql' | |
require 'virtus' | |
module ActiveRecord | |
class Base | |
def self.inherited(klass) | |
rel_class = Class.new(ROM::Relation[:sql]) { | |
base_name Inflecto.tableize(klass.name).to_sym | |
} | |
dataset = repository.dataset(rel_class.base_name) |
require 'zeus/rails' | |
class CustomPlan < Zeus::Rails | |
def truncate_db | |
require 'database_cleaner' | |
DatabaseCleaner.clean_with :truncation | |
end | |
def test |
# Support for Rspec / Capybara subdomain integration testing | |
# Make sure this file is required by spec_helper.rb | |
# (e.g. save as spec/support/subdomains.rb) | |
def switch_to_subdomain(subdomain) | |
# lvh.me always resolves to 127.0.0.1 | |
hostname = subdomain ? "#{subdomain}.lvh.me" : "lvh.me" | |
Capybara.app_host = "http://#{hostname}" | |
end |
require 'openssl' | |
class String | |
def encrypt(key) | |
cipher = OpenSSL::Cipher.new('DES-EDE3-CBC').encrypt | |
cipher.key = Digest::SHA1.hexdigest key | |
s = cipher.update(self) + cipher.final | |
s.unpack('H*')[0].upcase | |
end |
git branch | grep "*" | awk '{ print $2 }' | pbcopy |