Skip to content

Instantly share code, notes, and snippets.

@gigorok
gigorok / gist:3798538
Created September 28, 2012 07:58
HTML: Autosubmit form through POST request
<form name="myform">
<input type="hidden" name="var1" value="5" />
</form>
<script type="text/javascript">
document.myform.submit();
</script>
@johnferrie
johnferrie / media-query-mixin.scss
Created October 4, 2012 21:05 — forked from Snugug/media-query-mixin.scss
Media Query Sass Mixin
//////////////////////////////
// Generalized Media Query Mixin
//
// Requires Sass 3.2+
// Until released:
// (sudo) gem install sass --pre
//////////////////////////////
@mixin media-query($value, $operator: 'min-width', $query: 'screen') {
@media #{$query} and (#{$operator}: #{$value}) {
@content;
@johnferrie
johnferrie / _filter.sass
Created October 4, 2012 21:08
CSS3 Filter Effects Sass Mixin
// https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html
//
// grayscale ex: filter: grayscale(100%);
// sepia ex: filter: sepia(100%);
// saturate ex: filter: saturate(0%);
// hue-rotate ex: filter: hue-rotate(45deg);
// invert ex: filter: invert(100%);
// brightness ex: filter: brightness(15%);
// contrast ex: filter: contrast(200%);
// blur ex: filter: blur(2px);
@wpscholar
wpscholar / vagrant-cheat-sheet.md
Last active July 2, 2024 09:21
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@octalmage
octalmage / roles.md
Last active May 14, 2023 17:43
Default WordPress user roles and capabilities.

WordPress v4.3.1

Admin wp_capabilities wp_user_level 10

a:1:{s:13:"administrator";b:1;}

Contributor wp_capabilities wp_user_level 1

CREATE TABLE `wp_yoast_seo_links` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`url` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`post_id` bigint(20) unsigned NOT NULL,
`target_post_id` bigint(20) unsigned NOT NULL,
`type` varchar(8) COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `link_direction` (`post_id`,`type`)
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
@Mte90
Mte90 / snippet.php
Last active February 24, 2021 18:25
Custom WordPress Error Handler. Support Query Monitor and can be used as mu-plugin.
<?php
/*
* Plugin Name: Better errors
* Description: Better errors in log
* Author: Daniele Scasciafratte
* Version: 1.0
* Author URI: http://codeat.co
*/
function handleError($code, $description, $file = null, $line = null, $context = null) {
@MogulChris
MogulChris / functions.php
Created August 26, 2020 23:52
WP Bakery / Visual Composer custom css on WooCommerce shop page
<?php
// The issue:
// You want to use WP Bakery for your WooCommerce shop page.
// You can enable WP Bakery for that page, but custom Design Options are not showing.
// The explanation:
// WP Bakery keeps those custom design changes as a CSS string, stored as post meta on the page you are using for your shop page.
// Unfortunately that CSS is not being output by your theme, hence your custom design changes are not working.