Skip to content

Instantly share code, notes, and snippets.

@ivcreative
ivcreative / add-unfiltered_html-capability-to-admins-or-editors.php
Created April 29, 2022 18:52 — forked from kellenmace/add-unfiltered_html-capability-to-admins-or-editors.php
Add unfiltered_html Capability to Admins or Editors in WordPress Multisite
<?php
/**
* Enable unfiltered_html capability for Editors.
*
* @param array $caps The user's capabilities.
* @param string $cap Capability name.
* @param int $user_id The user ID.
* @return array $caps The user's capabilities, with 'unfiltered_html' potentially added.
*/
@ivcreative
ivcreative / accessible-menu.css
Created October 1, 2021 14:42 — forked from AllThingsSmitty/accessible-menu.css
Accessible dropdown menu
/* Top level nav */
.nav {
float: left;
margin: 20px 0;
}
/* Dropdowns */
.nav ul {
position: absolute;
top: 2.5em;
// config
$_color-base-grey: rgb(229,231,234);
$palettes: (
purple: (
base: rgb(42,40,80),
light: rgb(51,46,140),
dark: rgb(40,38,65)
),
grey: (
base: $_color-base-grey,
@ivcreative
ivcreative / vanilla-cookies.js
Created November 18, 2020 15:58 — forked from billiegoose/vanilla-cookies.js
Vanilla Cookies - a dead simple yet full-featured JavaScript cookie library
// Vanilla Cookies - a dead simple yet full-featured JavaScript cookie library
// derived from http://stackoverflow.com/a/19189846
/*********************************************************
Gets the value of a cookie.
**********************************************************/
getCookie = function(sName)
{
var oCrumbles = document.cookie.split(';');
for(var i=0; i<oCrumbles.length;i++)
@ivcreative
ivcreative / flexbox.scss
Created May 1, 2020 13:26 — forked from richardtorres314/flexbox.scss
CSS Flexbox - Sass Mixins
// --------------------------------------------------
// Flexbox SASS mixins
// The spec: http://www.w3.org/TR/css3-flexbox
// --------------------------------------------------
// Flexbox display
@mixin flexbox() {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
@ivcreative
ivcreative / bookmark.js
Created February 18, 2020 15:56 — forked from oilvier/bookmark.js
Javascript to add a bookmark - Cross Browser
/**
*
* Add to bookmark
* Several tests are necessary in order for this "simple" action to work in most of the browsers
*
*/
// First, we define the element where the "Add to bookmark" action will trigger
var triggerBookmark = $(".js-bookmark"); // It must be an `a` tag
@ivcreative
ivcreative / index.html
Created October 2, 2019 23:28 — forked from A973C/index.html
A CodePen by A973C. Horizontal Portfolio Layout with CSS3 Animations and jQuery - Demo for my blog post: http://blog.sarasoueidan.com/horizontal-portfolio-layout
<header>
<a href="http://blog.sarasoueidan.com/horizontal-portfolio-layout">Read Tutorial</a>
</header>
<div class="demo-wrapper">
<!-- <h1>Horizontal Portfolio Layout With CSS3 Animations and jQuery</h1> -->
<ul class="portfolio-items">
<li class="item">
@ivcreative
ivcreative / Featured Image Instructions
Created August 10, 2019 14:35 — forked from spencejs/Featured Image Instructions
Add Instruction Text To Featured Image Box In Wordpress Admin
@ivcreative
ivcreative / sass-transforms
Created June 23, 2019 21:34 — forked from fieldoffice/sass-transforms
Sass Transform Mixins
// Browser Prefixes
@mixin transform($transforms) {
-webkit-transform: $transforms;
-moz-transform: $transforms;
-ms-transform: $transforms;
transform: $transforms;
}
// Rotate
@mixin rotate ($deg) {
@ivcreative
ivcreative / random_strgenerator.php
Created September 3, 2018 20:05 — forked from irazasyed/random_strgenerator.php
PHP: Generate random string
/**
* Generate and return a random characters string
*
* Useful for generating passwords or hashes.
*
* The default string returned is 8 alphanumeric characters string.
*
* The type of string returned can be changed with the "type" parameter.
* Seven types are - by default - available: basic, alpha, alphanum, num, nozero, unique and md5.
*