Skip to content

Instantly share code, notes, and snippets.

@mickmister
mickmister / scrape_new_plugins.sh
Last active April 18, 2024 16:45
This bash script checks if there are any new plugins added to the Mattermost plugin marketplace, and creates a new post through a Mattermost incoming webhook request. The script downloads the latest listing, and compares that with a locally stored version of the listing. On the first run of the script, no post will be made since there is nothing…
#!/usr/bin/env bash
if [ -z "$MM_WEBHOOK_URL" ]
then
echo "Please set the MM_WEBHOOK_URL environment variable"
exit 0
fi
LOCAL_PLUGINSJSON_PATH="plugins.json"
REMOTE_PLUGINSJSON_PATH="new_plugins.json"
@annezazu
annezazu / content lock pattern
Last active April 18, 2024 16:45
An example of a pattern with content locking implemented.
function register_block_patterns() {
if ( class_exists( 'WP_Block_Patterns_Registry' ) ) {
$content = '<!-- wp:group {"templateLock":"contentOnly","align":"wide","layout":{"type":"constrained"}} -->
<div class="wp-block-group alignwide"><!-- wp:image {"align":"wide","id":501,"sizeSlug":"full","linkDestination":"none","style":{"color":{"duotone":["#1a4548","#ffffff"]}}} -->
<figure class="wp-block-image alignwide size-full"><img src="https://s.w.org/patterns/files/2021/06/Group-17-scaled.jpg" alt="Image of a woman being carried through the air by swans." class="wp-image-501"/></figure>
<!-- /wp:image -->
<!-- wp:columns {"verticalAlignment":"center","align":"wide"} -->
@basham
basham / css-units-best-practices.md
Last active April 18, 2024 16:44
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units

Installing a Colorfront central linux database

Instructions are current for Transkoder 2020.
This has been tested on CentOS 7.9, but you can adapt to other distributions. Throughout this guide, the # symbol signifies running a shell command as root.

Install LAMPP web server

Supported versions:

  • PHP 7.1 - 7.2
  • MariaDB 10.1 - 10.4
  • Apache 2.4
@bmatthewshea
bmatthewshea / certbot_pip_install-debian_ubuntu.md
Last active April 18, 2024 16:40
Debian/Ubuntu - CERTBOT without SNAP/SNAPD

CERTBOT - Install using Python PIP

Install Certbot using Python PIP (Package Installer for Python) - without using SNAP, APT or SYSTEMD. (Debian/Ubuntu)


This guide will help you install LetsEncrypt / Certbot using venv PIP under Debian/Ubuntu.

  • This guide has been tested up to Debian 12 / Bookworm.

radare2

load without any analysis (file header at offset 0x0): r2 -n /path/to/file

  • analyze all: aa
  • show sections: iS
  • list functions: afl
  • list imports: ii
  • list entrypoints: ie
  • seek to function: s sym.main
@rise-worlds
rise-worlds / For Mac 4.2.6 unlimited trial.md
Last active April 18, 2024 16:35 — forked from satish-setty/trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher, 4.2.5,4.2.6,4.3.7, it's works, this is the way which makes Always in evaluation mode.

  1. open Terminal, go to the dir : cd /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak: mv BCompare BCompare.bak
  3. touch a file name BCompare , and chmod a+ux BCompare : touch BCompare && chmod a+ux BCompare
  4. open BCompare with text editor, insert the script :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@
// Add ChatGPT Menu
const onOpen = () => {
const ui = SpreadsheetApp.getUi();
ui.createMenu("ChatGPT")
.addItem("💾 Save Responses as Text", "saveAsText")
.addItem("ChatGPT API Sheet by Sarah Tamsin 💜", "openUrl")
.addToUi();
};
@marlonramirez
marlonramirez / HolidayUtil.java
Last active April 18, 2024 16:33
Gestión de fechas en colombia, días habiles, festivos, etc.
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
public class HolidayUtil {
private int year;
private int easterMonth;
private int easterDay;
private ArrayList<String> holidays;
@magthe
magthe / msys2.reg
Created September 11, 2014 06:56
MSYS2 "Open Here" registry settings
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\open_msys2]
@="Open MSYS2 here"
[HKEY_CLASSES_ROOT\Directory\Background\shell\open_msys2\command]
@="c:\\msys64\\usr\\bin\\mintty.exe /bin/sh -lc 'cd \"$(cygpath \"%V\")\"; exec bash'"
[HKEY_CLASSES_ROOT\Folder\shell\open_msys2]
@="Open MSYS2 here"