Skip to content

Instantly share code, notes, and snippets.

@jazzsequence
jazzsequence / add_unfiltered_html_to_editors.php
Last active September 15, 2024 13:29
Add `unfiltered_html` capability to editors on multisite.
<?php
/**
* Add `unfiltered_html` capability to editors (or other user roles).
* On WordPress multisite, `unfiltered_html` is blocked for everyone but super admins. This gives that cap back to editors
* and above.
*
* @author Justin Tadlock
* @link http://themehybrid.com/board/topics/add-unfiltered_html-capability-to-editor-role#post-4629
* @param array $caps An array of capabilities.
* @param string $cap The capability being requested.
@osvik
osvik / AddBrowserLanguagesAsClasses.js
Last active April 23, 2017 08:30
Add browser languages as CSS classes
/*jshint browser: true*/
/**
* Adds the content of navigator.languages or navigator.language as classes to body
* This script must be added after the opening <body> tag.
* @author Osvaldo Gago
*/
(function () {
@pmkay
pmkay / top-brew-packages.txt
Last active March 6, 2026 06:42 — forked from r5v9/top-brew-packages.txt
Top homebrew packages
node: Platform built on V8 to build network applications
git: Distributed revision control system
wget: Internet file retriever
yarn: JavaScript package manager
python3: Interpreted, interactive, object-oriented programming language
coreutils: GNU File, Shell, and Text utilities
pkg-config: Manage compile and link flags for libraries
chromedriver: Tool for automated testing of webapps across many browsers
awscli: Official Amazon AWS command-line interface
automake: Tool for generating GNU Standards-compliant Makefiles

SVGjs CHEAT SHEET

More info...

Begining of the svg file

Adobe Illustrator will give you something like this, but you must add the width and height attributes based in the viewBox.

<?xml version="1.0" encoding="utf-8"?>
@osvik
osvik / page-to-test.html
Last active July 11, 2021 22:00
Example on how to run tests in the browser. Running tests in the browser has advantages in many use cases as you can test the page in different mobile and desktop browsers and interact with the DOM.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Example of simple javascript testing in the browser</title>
</head>