Skip to content

Instantly share code, notes, and snippets.

<?php
/*
Plugin Name: Enable/Disable plugins when doing local dev
Plugin URL: https://gist.github.com/pbiron/52bb63042cf220256ece89bc07fb57b0
Description: If the WP_LOCAL_DEV constant is true, enables/disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Paul V. Biron/Sparrow Hawk Computing
Author URI: https://sparrowhawkcomputing.com
*/
@brendan-rius
brendan-rius / Dockerfile
Created June 13, 2018 22:19
DeamonSet for setting inotify config in each nodein k8s
FROM alpine
COPY configure-node.sh configure-node.sh
CMD ["/bin/sh", "configure-node.sh"]
@ruanbekker
ruanbekker / cheatsheet-elasticsearch.md
Last active March 31, 2025 14:50
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
@jgautheron
jgautheron / One import via join.yaml
Created May 10, 2017 17:43 — forked from jespereneberg/One import via join.yaml
Fn::ImportValue from other stacks
Tags:
- Key: Name
Value:
!Join ['_', [ ec2, "Fn::ImportValue" : {"Fn::Sub":'${BaseStackName}-Environment'}, test2]]
#This will create a name tag with value: ec2_<yourValueFromOtherStack>_test2
@thomasdarimont
thomasdarimont / LoginStatsRecordingRequiredActionProvider.java
Last active April 6, 2021 10:02
Keycloak RequiredAction for recording user information on login
package de.tdlabs.idm.keycloak.ext.authentication;
import static java.time.LocalDateTime.now;
import static java.util.Arrays.asList;
import java.util.List;
import org.jboss.logging.Logger;
import org.keycloak.Config.Scope;
import org.keycloak.authentication.RequiredActionContext;
@rvl
rvl / test-docker.nix
Last active September 28, 2020 23:22
Examples of using nixpkgs PR 11156 https://github.com/NixOS/nixpkgs/pull/11156
# How to build docker images (NIX_PATH and hydra cache required when building off master branch)
# export NIX_PATH=$HOME/dev
# nix-build --option extra-binary-caches http://hydra.nixos.org/ test-docker.nix | xargs -n1 docker load -i
with import <nixpkgs> {};
rec {
# 1. basic example
bash = dockerTools.buildImage {
name = "bash";
@chinshr
chinshr / Jenkinsfile
Last active February 9, 2025 02:39
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
#!groovy
# Best of Jenkinsfile
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
node {
}
#!/usr/bin/env python
import sys
import argparse
import ansible.constants as C
import ansible.inventory
import subprocess
def get_inventory(subset_pattern):
@hdknr
hdknr / axe.py
Created January 31, 2015 07:01
tmux session creator with Ansible hosts
from ansible.inventory.ini import InventoryParser
import os
from pycommand.command import Command, SubCommand
#
_CHECK_SESSION = "tmux has-session -t {session} 2> /dev/null "
_NEW_SESSION = "tmux new-session -d -s {session} '{ssh}'"
_NEW_WINDOW = "tmux new-window -t {session} '{ssh}'"
_ATTACH_SESSION = "tmux attach-session -t {session}"
@gregwork
gregwork / 1-readme.md
Last active August 29, 2015 14:04
Rakefile example

This example splits namespaces into different files, but that's likely overkill for most uses. Shoving everything in a Rakefile would work fine too.

To use this:

cd /tmp
mkdir raketest
cd raketest
touch Rakefile
mkdir rakelib