Skip to content

Instantly share code, notes, and snippets.

View walery's full-sized avatar
😎
Making things delightful!

Walery Strauch walery

😎
Making things delightful!
View GitHub Profile
@walery
walery / autovacuum.md
Last active September 18, 2020 14:19
postgresql

Autovacuum general stats

// TODO values in formula are hardcoded

SELECT
    ut.schemaname,
    ut.relname,
    ut.last_autovacuum,
    ut.n_tup_upd,
 ut.n_tup_del,
LambdaPermission:
Type: AWS::Lambda::Permission
Properties:
Action: lambda:invokeFunction
Principal: apigateway.amazonaws.com
FunctionName: arn:aws:lambda:REGION:ACCOUNT_ID:function:FUNCTION_NAME
SourceArn: arn:aws:execute-api:REGION:ACCOUNT_ID:REST_API_ID/STAGE/METHOD/PATH
# REST_API_ID
# Ref from `AWS::ApiGateway::RestApi`
@GrabConfig(systemClassLoader = true)
@Grab(group='org.postgresql', module='postgresql', version='42.1.4')
import groovy.sql.Sql
def db = [
url: 'jdbc:postgresql://dbHost/dbName',
user: 'user',
password: 'pw',
driver: 'org.postgresql.Driver'
[].forEach.call(document.querySelectorAll('thead.OGB th'), th => {
var tr = th.parentNode;
if (tr.nodeName !== "TR") {
return;
}
var tds = tr.childNodes;
if (tds.length !== 4) {
@walery
walery / commit-msg.sh
Created January 20, 2017 08:08
Prevents git commits without reference to JIRA. .sh extension in filename is just for gist syntax highlighting.
#!/bin/sh
#
# An example hook script to check the commit log message.
# Called by "git commit" with one argument, the name of the file
# that has the commit message. The hook should exit with non-zero
# status after issuing an appropriate message if it wants to stop the
# commit. The hook is allowed to edit the commit message file.
#
# To enable this hook, rename this file to "commit-msg".
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = Application.class)
@WebAppConfiguration
public class SomeControllerIT {

    @Autowired
    private SomeController underTest;
  • 165
  • 193
  • 199
  • 215
  • 217
  • 222 <-
  • 223
  • 224
  • 233
  • 235
<html>
<head>
<style>
.content {
background-color: #ff0000;
}
#container .tf:target {
display: block;
}

Foo.java

public class Foo {
    public Foo() {
    }
}

javap -p -c -s -verbose -constants -l Foo.class

Classfile /Users/walery/foo/jvm/Foo.class