Skip to content

Instantly share code, notes, and snippets.

@righettod
righettod / venom_security_headers_tests_suite.yml
Last active November 2, 2022 19:02
VENOM sample HTTP security response headers test suites.
name: HTTP security response headers test suites
# TOOLS
# VENOM HOME: https://github.com/ovh/venom
# VENOM RELEASE: https://github.com/ovh/venom/releases
# VENOM ASSERTION KEYWORDS: https://github.com/ovh/venom#assertion
# REF AND RUN
# REF BASE: https://owasp.org/www-project-secure-headers/
# RUN CMD: venom run --var="target_site=https://righettod.eu" venom_security_headers_tests_suite.yml
# venom run --var="target_site=https://righettod.eu" --var="internet_facing=true" venom_security_headers_tests_suite.yml
# venom run --var="target_site=https://righettod.eu" --var="internet_facing=true" --var="logout_url=/logout" venom_security_headers_tests_suite.yml
@thheller
thheller / benchmark.cljs
Last active August 6, 2019 20:00
dummy node benchmark for creating react elements in cljs
(ns shadow.grove.react.benchmark
(:require
["benchmark" :as b]
["react" :as react :rename {createElement rce}]
["react-dom/server" :as rdom]
[hx.react :as hx]
[shadow.grove.react :as shadow]
[reagent.core :as reagent]
[rum.core :as rum]
[fulcro.client.dom :as fulcro-dom]))
@zarkone
zarkone / notify.clj
Last active February 18, 2021 08:25
Clojure + PostgreSQL: NOTIFY example
(ns database
(:require [hikari-cp.core :as connection-pool]
[clojure.java.jdbc :as jdbc]
;; ...
))
(defn- to-datasource-options [{:keys [host port username password database-name]}]
@romainl
romainl / vanilla-linter.md
Last active May 6, 2024 01:48
Linting your code, the vanilla way

Linting your code, the vanilla way

You may want a linter plugin to lint your code in Vim but you probably don't need it. At least try the built-in way before jumping on the plugin bandwagon.

Defining makeprg

autocmd FileType <filetype> setlocal makeprg=<external command>

This autocommand tells Vim to use <external command> when invoking :make % in a <filetype> buffer. You can add as many similar lines as needed for other languages.

@iMilnb
iMilnb / README.md
Last active January 18, 2024 08:08
AWS Terraform configuration: Stream CloudWatch Logs to ElasticSearch

Rationale

This snippet is a sample showing how to implement CloudWatch Logs streaming to ElasticSearch using terraform. I wrote this gist because I didn't found a clear, end-to-end example on how to achieve this task. In particular, I understood the resource "aws_lambda_permission" "cloudwatch_allow" part by reading a couple of bug reports plus this stackoverflow post.

The js file is actually the Lambda function automatically created by AWS when creating this pipeline through the web console. I only added a endpoint variable handling so it is configurable from terraform.

@nelstrom
nelstrom / neovim-remote-editor.sh
Last active May 5, 2017 08:28
Inside Neovim :terminal, use neovim-remote as `$VISUAL`
if [ -n "$NVIM_LISTEN_ADDRESS" ]; then
export VISUAL="nvr -cc split --remote-wait +'set bufhidden=wipe'"
else
export VISUAL="nvim"
fi
@andrewchilds
andrewchilds / clubhouse.sh
Last active January 23, 2020 00:07
Clubhouse/git/deploy utility functions
# Clubhouse / git / deploy utility functions
#
# API docs: https://clubhouse.io/api
#
# Assuming the following:
# 1. We have a range of git commits that represent the changes being deployed
# 2. Our git branches and pull requests use the username/ch123/story-name format,
# so that "ch123" ends up in a commit message
# 3. We have a Clubhouse API token set to the $CLUBHOUSE_API_TOKEN environment variable
#
@mikeball
mikeball / core.clj
Last active June 3, 2020 13:22
Postgres listen/notify in Clojure using http://impossibl.github.io/pgjdbc-ng/
; Postgres listen/notify in Clojure using http://impossibl.github.io/pgjdbc-ng/
; in project.clj dependencies
; [com.impossibl.pgjdbc-ng/pgjdbc-ng "0.5"]
(ns pglisten.core
(:import [com.impossibl.postgres.jdbc PGDataSource]
[com.impossibl.postgres.api.jdbc PGNotificationListener]))