Skip to content

Instantly share code, notes, and snippets.

@adactio
adactio / autoLinkMastodonUsernames.php
Created October 30, 2023 13:11
A regular expression to convert @@ usernames into hyperlinks
<?php
/* Pass a string of text into the function to convert @@ usernames. */
function autoLinkMastodonUsernames($string) {
return preg_replace(
'/@?\b([A-Za-zŽžÀ-ÿ0-9._%+-]+)@([A-Za-zŽžÀ-ÿ0-9.-]+\.[A-Za-zŽžÀ-ÿ]{2,})\b/i',
'<a href="https://$2/@$1">$0</a>',
$string
@schulle4u
schulle4u / yellow-dev.md
Last active January 2, 2024 21:07
My development environment for Datenstrom yellow

My local development environment for Datenstrom yellow

This is just my own environment, please don't consider this as an official development guide. Operating systems and software will vary for your own needs. Please consult the internet for any installation help.

What you need

  • Windows 11 Pro, 64 Bit
  • Windows Subsystem for Linux (WSL2) running Debian 12
  • GitHub Desktop
@adactio
adactio / getBandcampArtist.php
Created October 21, 2021 12:06
Scraping Bandcamp for artist info.
<?php
function curlURL($url) {
$return = array();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
@schulle4u
schulle4u / settings.php
Last active October 12, 2023 11:33
#Datenstrom-Yellow Command extension to show extension settings
<?php
// Settings extension
class YellowSettings {
const VERSION = "0.1.3";
public $yellow; // access to API
// Handle initialisation
public function onLoad($yellow) {
$this->yellow = $yellow;
@bernardchri
bernardchri / ultrareset.css
Last active June 6, 2023 18:25
[css] ultrareset.css #css #reset
/*! de-style.css v1.0.5 | MIT License | https://github.com/nicolas-cusan/destyle.css */
* {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
img{
display: block;
max-width: 100%;
@oliveratgithub
oliveratgithub / readme.md
Created January 4, 2019 08:44
Configure the PHP CLI in macOS to use MAMP PHP binaries

Pre-requisites

Find MAMP's installed PHP version(s) you want to use the PHP CLI for:

$ ls -l /Applications/MAMP/bin/php/

Configure PHP CLI in macOS to use MAMP's PHP

  1. First, open your local user's .bash_profile in edit mode, in order to add aliases for accessing the PHP CLI locally
$ pico ~/.bash_profile
@yano3nora
yano3nora / fadein_fadeout.css
Created July 2, 2017 09:38
[css: fadeout/fadein] css sample. #css
.fadeOut {
animation : fadeOut 0.1s;
animation-fill-mode: both;
}
@keyframes fadeOut {
0% {
opacity: 1;
height: initial;
}
100% {
@adactio
adactio / sectioningcontenttest.html
Created November 12, 2011 12:19
Illustration of sectioning content and the outline algorithm in HTML5.
<!DOCTYPE html>
<html lang="en">
<title>Sectioning Content test</title>
<h1>This is an h1</h1>
<p>That h1 is the heading for the body (a sectioning root).</p>
<div>
<h1>This is another h1</h1>
<p>That h1 is inside a div so it is no different than the first h1.</p>
</div>
<section>