Skip to content

Instantly share code, notes, and snippets.

View seandavi's full-sized avatar

Sean Davis seandavi

View GitHub Profile
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active August 8, 2025 10:18
set -e, -u, -o, -x pipefail explanation
@batpigandme
batpigandme / data_mask_tidy_eval.Rmd
Created November 15, 2018 22:59
Playing w/ data mask example from tidy eval cheatsheet
---
title: "Data mask stuff"
output: github_document
---
```{r include=FALSE, message=FALSE, warning=FALSE}
knitr::opts_chunk$set(
message = FALSE, warning = FALSE, echo = TRUE, fig.retina = 2, collapse = TRUE
)
```
@krlmlr
krlmlr / Rprofile-entrace
Last active January 7, 2021 01:59
Pretty stack traces in R
# Add this to your .Rprofile
options(
error = quote(rlang::entrace()),
rlang__backtrace_on_error = "collapse" # or "branch" or "full"
)
@akiross
akiross / starlettews.py
Created March 16, 2019 18:35
A simple example of using websockets with starlette.io (it's super easy, wow!)
from starlette.applications import Starlette
from starlette.responses import HTMLResponse
from starlette.websockets import WebSocket
from jinja2 import Template
import uvicorn
template = """\
<!DOCTYPE HTML>
<html>
@olihawkins
olihawkins / coronavirus-api.R
Last active June 10, 2021 08:50
Download data on Coronavirus cases and deaths from the government dashboard API
# Functions for downloading data on Coronavirus cases in the UK by country,
# region, NHS region, and local authority from the government dashboard API.
#
# The developer guide is here:
#
# https://coronavirus.data.gov.uk/developers-guide
#
# The code below is based on the example code shown there.
#
# Run ...
@kissgyorgy
kissgyorgy / listen.py
Created September 4, 2020 16:37
How to use PostgreSQL's LISTEN/NOTIFY as a simple message queue with psycopg2 and asyncio
import asyncio
import psycopg2
# dbname should be the same for the notifying process
conn = psycopg2.connect(host="localhost", dbname="example", user="example", password="example")
conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)
cursor = conn.cursor()
cursor.execute(f"LISTEN match_updates;")
@SwitHak
SwitHak / 20211210-TLP-WHITE_LOG4J.md
Last active July 2, 2025 20:42
BlueTeam CheatSheet * Log4Shell* | Last updated: 2021-12-20 2238 UTC

Security Advisories / Bulletins / vendors Responses linked to Log4Shell (CVE-2021-44228)

Errors, typos, something to say ?

  • If you want to add a link, comment or send it to me
  • Feel free to report any mistake directly below in the comment or in DM on Twitter @SwitHak

Other great resources

  • Royce Williams list sorted by vendors responses Royce List
  • Very detailed list NCSC-NL
  • The list maintained by U.S. Cybersecurity and Infrastructure Security Agency: CISA List
@palewire
palewire / README.md
Last active May 24, 2023 18:09
How to deploy a Prefect agent to Google Kubernetes Engine

How to deploy a Prefect agent to Google Kubernetes Engine

This post contains code and commands you can use to deploy Prefect agents to Google Cloud’s Google Kubernetes Engine. The agents stand ready to execute workflows triggered by Prefect projects. One agent can run tasks from multiple projects.

The example here demonstrates how to create a single agent with minimal customization. It is configured with a Dockerfile, which installs necessary dependencies, and a k8s.cfg file, which connects the system to a Prefect account.

Agents are deployed via the gcloud command-line utility and its kubectl extension. Proper permissions within a project on Google Cloud are required.

Getting started