Skip to content

Instantly share code, notes, and snippets.

View virgilwashere's full-sized avatar
😎
Investigating ways to increase technical debt with shiny

Virgil virgilwashere

😎
Investigating ways to increase technical debt with shiny
View GitHub Profile
#!/bin/bash
# variables
LOGFILE="/var/log/nginx/access.log"
LOGFILE_GZ="/var/log/nginx/access.log.*"
RESPONSE_CODE="200"
# functions
filters(){
grep $RESPONSE_CODE \
@scr4bble
scr4bble / readable-dates.php
Created February 6, 2018 19:30
Adminer plugin that replaces UNIX timestamps with human-readable dates.
<?php
/** This plugin replaces UNIX timestamps with human-readable dates in your local format.
* Mouse click on the date field reveals timestamp back.
*
* @link https://www.adminer.org/plugins/#use
* @author Anonymous
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
@heathdutton
heathdutton / backlog.sql
Last active November 1, 2018 19:05
mautic:campaign:trigger backlog
/* Lead ingestion behind - Leads waiting to be processed by a campaign */
SELECT cl.campaign_id as campaign_id, count(cl.lead_id) as lead_count FROM campaign_leads cl WHERE (cl.manually_removed = 0) AND (NOT EXISTS (SELECT null FROM campaign_lead_event_log e WHERE (cl.lead_id = e.lead_id) AND (e.campaign_id = cl.campaign_id))) GROUP BY cl.campaign_id LIMIT 100;
-- Faster:
SELECT cl.campaign_id AS campaign_id, c.name as campaign_name, count(cl.lead_id) AS lead_count, c.is_published AS published
FROM campaign_leads cl
LEFT JOIN campaigns c
ON c.id = cl.campaign_id
WHERE (NOT EXISTS (
SELECT null FROM campaign_lead_event_log e
WHERE
@escopecz
escopecz / form.html
Last active April 23, 2024 17:29
An example of how to send a form submission to a Mautic form with jQuery
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Mautic Form Test</title>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
@proffalken
proffalken / README.md
Last active April 25, 2023 21:38
Mautic Nginx Configuration

Mautic Nginx Configuration

These files allow you to configure Mautic using Nginx.

@victor-perez
victor-perez / git.bat
Last active August 4, 2021 14:16
Use WSL git inside VS Code from Windows 10 17046
@echo off
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
::this also support calls that contains a absolute windows path
::check of one of the params contain a absolute windows path
echo.%* | findstr /r /c:"[a-z]:[\\/]" > nul
if %errorlevel% == 1 (
::if not just git with the given parameters
call :git %*
@skwashd
skwashd / README.md
Last active April 2, 2024 15:59
Copy AWS SSM Parameter Store Path

This Python (3.6+) script is for migrating Amazon AWS System Manager (SSM) Parameter Store keys from one path to another.

Quick Start

To install the script do the following:

  • Configure your AWS credentials
  • Grab the code from this gist
  • Make it executable (chmod +x /path/to/copy-ssm-ps-path.py)
  • pip install boto3 (if you don't have it installed already)
@snarbin
snarbin / osx_bootstrap.sh
Last active April 5, 2019 06:17 — forked from codeinthehole/osx_bootstrap.sh
Script to install stuff I want on a new OSX machine
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Xcode (for command line tools)
@pnancarrow
pnancarrow / aws_security_group_details.sh
Last active August 21, 2021 20:29 — forked from richadams/aws_security_group_details.sh
A quick and dirty script to list out all security group settings on an AWS account. Barely tested, use at own risk, etc. Requires awscli to be installed.
#!/bin/bash
# Requires: awscli (http://aws.amazon.com/cli/)
# Prints out a list of all security groups and their settings, just for quickly auditing it.
# Your AWS credentials
#if [ -z ${AWS_ACCESS_KEY_ID} ]; then
# export AWS_ACCESS_KEY_ID='***'
# export AWS_SECRET_ACCESS_KEY='***'
#fi