Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
WITH table_scans as ( | |
SELECT relid, | |
tables.idx_scan + tables.seq_scan as all_scans, | |
( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes, | |
pg_relation_size(relid) as table_size | |
FROM pg_stat_user_tables as tables | |
), | |
all_writes as ( | |
SELECT sum(writes) as total_writes | |
FROM table_scans |
initialize
: once, when the controller is first instantiatedconnect
: anytime the controller is connected to the DOMruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
require 'optparse' | |
require 'json' | |
require 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'redis' | |
gem 'oj' | |
end |
import { Controller } from 'stimulus'; | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import AppContainer from 'components/core/AppContainer'; | |
export default class extends Controller { | |
connect() { | |
const Component = window.ReactComponents[this.data.get('component')]; | |
let props = this.data.get('props') || {}; | |
if (typeof props === 'string') { |
https://jennamolby.com/how-to-use-cookies-to-capture-url-parameters/ | |
// Parse the URL | |
function getParameterByName(name) { | |
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); | |
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"); | |
var results = regex.exec(location.search); | |
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); | |
} |