Skip to content

Instantly share code, notes, and snippets.

@nunks
nunks / pmpro-custom-content-message.php
Last active September 26, 2021 06:14
Snippet to rewrite the "no access" message
<?php
/*
* Rebuilds the "no access" message before Paid Memberships Pro applies any substitution.
* Parses current post for [membership] shortcodes as needed.
* Here I'm just getting rid of the "Oxford comma", but it can be used for
* rebuilding the message any way you like.
*/
//the filters are called by PMPro just before any "!!" variable substitution:
// https://github.com/strangerstudios/paid-memberships-pro/blob/2190e731fbb7ccebfa07f246f926859de014e79a/includes/functions.php#L1928
// Roland V-Drums TD-17 drum module MIDI note name map for Cockos Reaper DAW
59 RIDE <EDGE>
58 TOM3 <RIM>
57 CRASH2 <BOW>
55 CRASH1 <EDGE>
53 RIDE <BELL>
52 CRASH2 <EDGE>
51 RIDE <BOW>
50 TOM1 <RIM>
49 CRASH1 <BOW>
@nunks
nunks / encrypt_openssl.md
Created July 26, 2018 00:56 — forked from dreikanter/encrypt_openssl.md
File encryption using OpenSSL

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

@nunks
nunks / win2utf.sh
Created April 5, 2018 19:42
Shell script to convert CP850 (windows command line) to UTF-8, for quick use in cygwin
#!/bin/bash
file="${1:-/dev/stdin}";
iconv -f CP850 -t UTF-8 "$file";
@nunks
nunks / fetch-anon-gist.js
Created January 8, 2018 22:56
Fetch api: posting anonymous gist
fetch("https://api.github.com/gists",
{
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
method: "POST",
body: JSON.stringify({
"description":"teste de post de gist anonimo",
"public":true,
@nunks
nunks / pa.toggle.headphones.sh
Last active March 9, 2018 12:52
Bash script for toggling audio output between headphone and speaker in Samsung Chromebooks running Ubuntu-based GalliumOS
#!/bin/bash
#
# Samsung Celes Chromebook (Braswell) - GalliumOS
#
# Toggles PulseAudio internal audio sink port between "[Out] Headphones" and "[Out] Speaker"
# Internal audio sink seems to be sink #1, as opposed to #0:HDMI audio
#
# Required packages:
# pulseaudio, pulseaudio-utils, libnotify-bin and numix-icon-theme.
#