Informational 2 min read

A test post showing markup in my posts using Prism.css

Some tests of the prism js and css implementation here on the new blog to check formatting.

Bash

/usr/local/bin> cd /i/am/a/banana
/i/am/a/banana> cd -
/usr/local/bin>

Powershell

if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
    $scriptPath = $myinvocation.mycommand.path
    Start-Process pwsh -Verb runAs -ArgumentList "-File $scriptPath"
    exit
}

PHP 

<?php
    $images = require 'images_array.php';
    echo $images[array_rand($images)];
?>

TypeScript

export const shuffle = <T>(arr: T[]): T[] =>
  arr
    .map((a) => ({ sort: Math.random(), value: a }))
    .sort((a, b) => a.sort - b.sort)
    .map((a) => a.value);

Python

found = False
for x in sequence:
    if pred(x.n):
        found = True
if found:

SQL

SELECT @randomString = CONVERT(varchar(255), NEWID())
   

YAML

person:
  name: "Alice"
  age: 30
  hobbies:
    - "reading"
    - "coding"
  address:
    city: "Tech City"
    zip: "12345"

HTML

<!DOCTYPE html>
<html>
<body>

<h2>Random Number Generator</h2>
<p>Click the button to generate a random number between 0 and 9.</p>

<button onclick="generateRandom()">Generate Random Number</button>
<p id="demo"></p>

<script>
function generateRandom() {
    document.getElementById("demo").innerHTML = Math.floor(Math.random() * 10);
}
</script>

</body>
</html>

CSS

:root {
  --primary-color: #007bff;
  --font-size: 16px;
}

.button {
  background-color: var(--primary-color);
  font-size: var(--font-size);
}

Plain Text

A common example of a small, plain text code snippet for generating dummy text is using the RAND function in Microsoft Word. This feature allows users to quickly generate random paragraphs of filler text (like Lorem Ipsum) for layout testing or formatting practice without needing to type manually.
Tags:
Share: Bluesky LinkedIn Facebook
All Posts

0 Comments

Leave a Comment

Never displayed publicly.
Comments are moderated before appearing.