Skip to content

Instantly share code, notes, and snippets.

@spigists
spigists / new_gist_file.css
Created October 2, 2013 16:16
Bootstrap 3 styles for Gravity Forms, make sure that in Forms > Settings you have Output CSS set to No and Output HTML5 set to Yes
.gform_wrapper ul {
padding-left: 0;
list-style: none; }
.gform_wrapper li {
margin-bottom: 15px; }
.gform_wrapper form {
margin-bottom: 0; }
@kerimdzhanov
kerimdzhanov / random.js
Last active October 8, 2025 02:54
JavaScript: get a random number from a specific range
/**
* Get a random floating point number between `min` and `max`.
*
* @param {number} min - min number
* @param {number} max - max number
* @return {number} a random floating point number
*/
function getRandomFloat(min, max) {
return Math.random() * (max - min) + min;
}
@nicomollet
nicomollet / infinite-scroll-orderby-meta.php
Last active May 30, 2016 16:32
Jetpack Infinite Scroll: Posts ordered by meta value
<?php
// Inspired by Isotrope code: https://gist.github.com/isotrope/1930f90518bdbfa074c3 and MCSF https://gist.github.com/mcsf/6c5cda9ee61acc8849c6
// Creates a query var called "tri"
function query_vars_tri( $vars ){
$vars[] = "tri";
return $vars;
}
add_filter( 'query_vars', 'query_vars_tri' );