This repository is intended for bootstrapping developer environment.
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
CREATE TABLE audit_log ( | |
username text, -- who did the change | |
event_time_utc timestamp, -- when the event was recorded | |
table_name text, -- contains schema-qualified table name | |
operation text, -- INSERT, UPDATE, DELETE or TRUNCATE | |
before_value json, -- the OLD tuple value | |
after_value json -- the NEW tuple value | |
); | |
CREATE OR REPLACE FUNCTION audit_trigger() |
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 | |
# Extracted from traceroute gem + checking the presence of views as well | |
require_relative './config/environment.rb' | |
class Traceroute | |
def initialize(app) | |
@app = app | |
end |
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
-- List all existing indexes and include some useful info about them (incl. the index's definition) | |
SELECT | |
schemaname AS schemaname, | |
t.relname AS tablename, | |
ix.relname AS indexname, | |
regexp_replace(pg_get_indexdef(i.indexrelid), '^[^\(]*\((.*)\)$', '\1') AS columns, | |
regexp_replace(pg_get_indexdef(i.indexrelid), '.* USING ([^ ]*) \(.*', '\1') AS algorithm, | |
indisunique AS UNIQUE, | |
indisprimary AS PRIMARY, |
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" | |
import Inputmask from 'inputmask'; | |
export default class extends Controller { | |
static targets = ['employees', 'amount', 'fullresult', 'result', 'economy', 'resultContent', 'calculator', 'id', 'emailBtn', 'leadBtn'] | |
connect(){ | |
this.params = ['employees', 'amount', 'fullresult', 'result', 'economy', 'id'] | |
var _component = this | |
this.state = 'valid' | |
var im = new Inputmask('999,99') |
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
export default class BaseValidator { | |
constructor(value, options, errorMessages) { | |
this.value = value | |
this.options = options | |
this.errorMessages = errorMessages | |
} | |
validate() { | |
return { valid: false, message: 'Implement me!'} | |
} |
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
div data-controller='tabs' data-tabs-index='1' | |
.tabs.is-boxed.is-marginless | |
ul | |
li data-target='tabs.tab' | |
a data={action: "tabs#change"} Tab 1 | |
li data-target='tabs.tab' | |
a data={action: "tabs#change"} Tab 2 | |
.tab.box data={target: 'tabs.tabPanel'} Tab panel 1 | |
.tab.box data={target: 'tabs.tabPanel'} Tab panel 2 |
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 { | |
onInput = (e) => this.updateHiddenInput(e.target.value); | |
connect() { | |
this.element.addEventListener('input', this.onInput); | |
this.initializeHiddenInput(); | |
this.initializeInput(); | |
} |
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 UploadAdapter from './upload_adapter'; | |
function CustomUploadAdapterPlugin( editor ) { | |
editor.plugins.get( 'FileRepository' ).createUploadAdapter = ( loader ) => { | |
// Configure the URL to the upload script in your back-end here! | |
return new UploadAdapter( loader, editor ); | |
}; | |
} | |
import { Controller } from "stimulus" |
NewerOlder