Skip to content

Instantly share code, notes, and snippets.

View mbtools's full-sized avatar
📦
Busy building apm 😀

Marc Bernard mbtools

📦
Busy building apm 😀
View GitHub Profile
@brittanyellich
brittanyellich / BlueskyComments.tsx
Created August 5, 2025 21:49
Showing Likes and Comments on Bluesky
import React from "react";
export type CommentPost = {
post: {
author: {
did: string;
handle: string;
displayName: string;
avatar: string;
};
<?php
/**
* Plugin Name: Disable Textdomain Error
* Description: Prevents triggering errors for the '_load_textdomain_just_in_time' function.
* Author: Kowsar Hossain
* Version: 1.0
*
* Note: This is a Must-Use (MU) plugin. Place this file in the 'wp-content/mu-plugins' directory.
*/
@theaog
theaog / update-golang.sh
Last active August 12, 2025 07:43
update-golang.sh
#!/usr/bin/env bash
set -e
tmp=$(mktemp -d)
pushd "$tmp" || exit 1
function cleanup {
popd || exit 1
rm -rf "$tmp"
}
@g-back
g-back / zcl_im_cts_request_check.abap
Created November 16, 2021 15:43
Example, CTS BAdI: Check if objects are included in abapGit repos
CLASS zcl_im_cts_request_check DEFINITION
PUBLIC
FINAL
CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES if_ex_cts_request_check.
PROTECTED SECTION.
PRIVATE SECTION.
@nandorojo
nandorojo / private-npm-in-gh-actions.md
Created August 3, 2021 23:52
Use private NPM packages in your GitHub actions

1 NPM_TOKEN

Add an NPM_TOKEN secret on GitHub. Get your secret key from the NPM dashboard.

2 Add a step to your action

- name: Authenticate with private NPM package
  run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
@jongio
jongio / PhotoOrganizer.ps1
Created March 3, 2021 15:34
A PowerShell script to organize photos by date taken
Param(
[string]$source,
[string]$dest,
[string]$format = "yyyy/yyyy_MM/yyyy_MM_dd"
)
$shell = New-Object -ComObject Shell.Application
function Get-File-Date {
[CmdletBinding()]
@sindresorhus
sindresorhus / esm-package.md
Last active October 13, 2025 05:46
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@larryclaman
larryclaman / convert-to-spot.ps1
Created April 8, 2020 19:23
Convert an Azure VM to a Spot VM type
<# Convert a VM to a Spot VM
Based on sample script at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/change-availability-set
NOTE: Extensions will not be copied to new instance!!
#>
# Set variables to your specifics
$resourceGroup = "myRG"
$vmName = "myVM"
# Get the details of the VM to be moved to the Availability Set
@sandraros
sandraros / test_of_cl_http_utility_unescape_url.abap
Last active August 17, 2020 14:00
Test class to verify the behavior of cl_http_utility=>unescape_url, that all escaped characters (from %00 to %EF%BF%BF which are equivalent to U+0000 to U+FFFF) are unescaped correctly, and more...
* SUMMARY OF SPECIFIC BEHAVIORS:
*
* input string (formatted as string template) returned string (formatted as string template)
* ------------------------------------------- -----------------------------------------
* any string containing %00 return empty string
* unencoded null character null character returned unchanged
* A%0AB A\nB
* A%0DB A\rB
* A%B return empty string
* A+B A B