Skip to content

Instantly share code, notes, and snippets.

View wesruv's full-sized avatar
🤔
Why can I have a status?

wesruv wesruv

🤔
Why can I have a status?
View GitHub Profile
@wesruv
wesruv / muh_module.php
Last active September 15, 2024 03:34
Force Drupal to show what timezone a date is being set in 😑
<?php
/**
* Implements template_preprocess_fieldset().
*/
function muh_module_preprocess_fieldset(&$variables) {
// Figure out if this is a "date field" fieldset
$hasElementValueType = isset($variables['element']) && isset($variables['element']['value']) && isset($variables['element']['value']['#type']);
if ($hasElementValueType && $variables['element']['value']['#type'] == 'datetime' && isset($variables['element']['value']['#date_timezone'])) {
// Show what timezone the date field is using as the fieldset description
@wesruv
wesruv / localdev.services.yml
Last active May 20, 2024 23:29
Drupal 8, 9, & 10 Theme Dev Config
# Should go in /sites/localdev.services.yml, or wherever the container_yamls setting in settings.local.php is set to look for it
# Local development services.
#
# To activate this feature, follow the instructions at the top of the
# 'example.settings.local.php' file, which sits next to this file.
parameters:
http.response.debug_cacheability_headers: true
twig.config:
debug: true
@wesruv
wesruv / overridingstyles.css
Last active August 27, 2024 18:24
Redmine style updates
/**
* Most up to date version here:
* https://gist.github.com/wesruv/cc6e733f1ab059393a0615e233a180ab
*/
body {
font-family: 'Liberation Sans', Helvetica, Arial, sans-serif;
font-size: 1rem;
line-height: 1.6;
color: #111;
@wesruv
wesruv / file.js
Last active October 11, 2023 20:57
Translations
'en': {
primaryListLabel: 'Quick links: redhat.com, Customer Portal, Red&nbsp;Hat\'s developer site, Red&nbsp;Hat\'s partner site',
youAreHere: 'You are here',
redHatDescription: 'Learn about our open source products, services, and company.',
portalDescription: 'Get product support and knowledge from the open source experts.',
developersDescription: 'Read developer tutorials and download Red&nbsp;Hat software for cloud application development.',
connectDescription: 'Get training, subscriptions, certifications, and more for partners to build, sell, and support customer solutions.',
productsHeading: 'Products & tools',
ansibleDescription: 'Learn about and try our IT automation product.',
ecosystemDescription: 'Find hardware, software, and cloud providers―and download container images―certified to perform with Red&nbsp;Hat technologies.',
@wesruv
wesruv / markdown_live_preview.mjs
Created April 7, 2023 20:37
Codemirror 6 Implementation (In Progress)
import { EditorView, basicSetup } from "codemirror";
import { keymap } from "@codemirror/view";
import { EditorState, Compartment } from "@codemirror/state";
import { indentWithTab } from "@codemirror/commands";
import { markdown } from "@codemirror/lang-markdown";
import { color, oneDark, oneDarkHighlightStyle, oneDarkTheme } from "@codemirror/theme-one-dark";
// Setup to update settings?
let language = new Compartment, tabSize = new Compartment;
@wesruv
wesruv / 1_creating-vm.md
Created January 21, 2023 18:27
Creating a LAMP local dev environment with Virtualbox

Creating a Virtualbox Linux VM for local LAMP dev

Download and Install Virtualbox

https://www.virtualbox.org/wiki/Downloads Choose the version for the host machine, so if you’re on Windows, choose that, if Mac, choose that.

Download Ubuntu Server

@wesruv
wesruv / settings.php
Last active October 14, 2022 19:11
Environment Indicator settings
<?php
switch ($environment) {
case 'local':
$config['environment_indicator.indicator']['name'] = 'Local';
$config['environment_indicator.indicator']['fg_color'] = '#ffffff';
$config['environment_indicator.indicator']['bg_color'] = '#005fab';
break;
case 'dev':
case 'preview':
$config['environment_indicator.indicator']['name'] = 'Dev';
java.nio.file.FileSystemException: /home/wruvalca/juno/asciidoc_local_render/output/rhel-8/titles/RHEL-System-Roles-7.9/administration-and-configuration-tasks-using-system-roles-in-rhel-7.9/modules/proc_requesting-a-new-certificate-from-idm-ca-using-the-certificate-system-role.adoc: Too many open files
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at com.redhat.ganymede.asciidoctorj.core.Converter.hash(Converter.java:211)
@wesruv
wesruv / cheatsheet.md
Last active May 20, 2022 22:50
Linux CLI Beginner Cheatsheet

Basics

Here's some Linux (particularly Ubuntu) Command Line Interface (CLI) basics

# Command for listing files
ls

# Shows all files and in a nicer layout with the options l and a
ls -la

Creating a Virtualbox Linux VM for local LAMP dev

Download and Install Virtualbox

https://www.virtualbox.org/wiki/Downloads Choose the version for the host machine, so if you’re on Windows, choose that, if Mac, choose that.

!IMPORTANT: On Windows, run the install for Virtualbox as Admin, if you do not network drivers for the VM won't be installed and VM's won't be able to connect to the internet.