Skip to content

Instantly share code, notes, and snippets.

View carlitoescobar's full-sized avatar
👁️
Looking

Carlito carlitoescobar

👁️
Looking
View GitHub Profile
@jgravois
jgravois / _webserver.md
Last active July 20, 2024 10:43
a simple guide for getting a local web server set up

Do I have a web server running?


having a web server turned on doesn't necessarily mean you are serving pages on the world wide web. its what allows you to load your own static files (.html, .js etc.) in a browser via http://.

if you're not sure whether or not you have a web server running, no problem! its easy to confirm.

what happens when you visit http://localhost/?

@javierarques
javierarques / protractorAPICheatsheet.md
Last active July 10, 2024 11:24
Protractor API Cheatsheet
@paulcollett
paulcollett / functions.php
Last active December 19, 2023 04:42
Remove Yoast HTML Comments “This site is optimized with the Yoast WordPress SEO plugin”
// For Yoast SEO Plugin Version: 14.1+ add to your Wordpress Theme's functions.php...
// Remove All Yoast HTML Comments
// https://gist.github.com/paulcollett/4c81c4f6eb85334ba076
// Credit @devendrabhandari (https://gist.github.com/paulcollett/4c81c4f6eb85334ba076#gistcomment-3303423)
add_filter( 'wpseo_debug_markers', '__return_false' );
// For Yoast SEO Plugin Version: < 14.1 add to your Wordpress Theme's functions.php...
@brennon
brennon / gist:12b449bc6a5c223ef230
Created November 20, 2014 04:33
Protractor conditional testing
describe('conditional testing', function() {
it('should be able to test conditionally', function() {
browser.get('http://www.angularjs.org');
element(by.css('.theresnowaythisclassexists')).then(
function elementExists() {
expect(false).toBe(true);
},
function elementDoesNotExist() {
expect(true).toBe(true);
}
@brandonhimpfen
brandonhimpfen / menu-panel.php
Created February 1, 2014 19:54
Display a WordPress menu as a Twitter Bootstrap list group panel. Make sure to change the panel title, text and on line 2 - change the "menu-id"
echo '<div class="panel panel-default"><div class="panel-heading">Title Goes Here</div><div class="panel-body"><p>Description or whatever you want goes here.</p></div><ul class="list-group nav">';
wp_nav_menu( array( 'container' => false, 'menu_class' => 'list-group-item', 'theme_location' => 'menu-id', 'after' => '', 'items_wrap' => '%3$s' ));
echo '</ul></div>';
@AMNDesign
AMNDesign / functions.php
Last active October 10, 2018 17:47
Dynamically populate Gravity Forms fields with WordPress user info for logged in users using get_currentuserinfo().
<?php
//* Using the Gravity Forms editor, be sure to check "Allow field to be populated dynamically under Advanced Options
//* You will need to set the Field Parameter Name value to work with the filter as follows: gform_field_value_$parameter_name
//* Dynamically populate first name for logged in users
add_filter('gform_field_value_first_name', 'populate_first_name');
function populate_first_name($value){
global $current_user;
get_currentuserinfo();
return $current_user->user_firstname;
@pippinsplugins
pippinsplugins / gist:6357212
Created August 27, 2013 18:29
Send the "active subscription welcome email when manually changing a user to active in RCP
<?php
function pw_rcp_email_status( $new_status, $user_id ) {
if( 'active' != $new_status )
return;
rcp_email_subscription_status( $user_id, 'active' );
}
add_action( 'rcp_set_status', 'pw_rcp_email_status', 10, 2 );
@bhays
bhays / Quantity Discounts
Last active December 5, 2020 21:38
Auto discount prices based on quantities in Gravity Forms. Uses a percentage based approach.
(function($){
$.fn.quantityDiscounts = function(options) {
// set up default options
var defaults = {
discountColor: '#FF0000',
discounts: [
{ limit: 174, discount: .75, text: "25% Discount Applied"},
{ limit: 139, discount: .80, text: "20% Discount Applied"},
@BlakeGardner
BlakeGardner / install nano.sh
Last active July 8, 2024 03:56
Syntax highlighting in nano on Mac OS
# Last updated May, 2024 for Apple silicon Macs
# Install Homebrew if you don't already have it: https://brew.sh
# install nano from homebrew
brew install nano nanorc
# update your nanorc file
echo 'include "'"$(brew --cellar nano)"'/*/share/nano/*.nanorc"' >> ~/.nanorc
# close and re-open your terminal and you'll have syntax highlighting
@isGabe
isGabe / get-highlight-terms.php
Last active February 12, 2022 16:22
WordPress: Output a list of taxonomy terms, then highlight the terms the belong to the current post. Updated to use in_array() to add a "current" CSS class to terms that the current post has. This way we don't have to worry about keeping up with terms in the CSS. Hooray for logic! #snippet #WordPress
<?php
/*
As the title implies, this will give you a way to
1. output a complete list of terms for a given taxonomy (nothing special there)
2. highlight the terms that the current post has (the magic!)
Probably need to figure out a better way to echo out the url of the term archive page...
*/