Skip to content

Instantly share code, notes, and snippets.

View espellcaste's full-sized avatar

Renato Alves espellcaste

View GitHub Profile
@konklone
konklone / https-workshop.md
Last active January 26, 2017 05:17
HTTPS Workshop notes

Workshop Outline

  1. Register domain and add your email now
  2. Introduction to Basic Concepts
  3. Create a login keypair
  4. Get a server (Digital Ocean)
  5. Point the domain at your server (an A Record)
  6. Log in and install stuff
  7. Buy the certificate with SSLMate
  8. Tell nginx to serve that domain and your certificate
@ntwb
ntwb / ntwb_bbpress_topic_reply_wp_search_results.php
Created September 26, 2014 07:13
bbPress - Include Topics and Replies in WordPress Search Results
<?php
/*
Plugin Name: bbPress - Include Topics and Replies in WordPress Search Results
Plugin URI: https://gist.github.com/ntwb/7363a1de1184d459f0c3
Description: bbPress - Include Topics and Replies in WordPress Search Results
Version: 0.1
Author: Stephen Edgar - Netweb
Author URI: http://netweb.com.au
*/
<?php
/**
* Plugin Name: bbPress Permalinks
* Plugin URI: http://korobochkin.com/
* Description: Change bbPress permalinks. ID number instead of topic slug. This links better than default if you have Cyrilic or other non english charackters in forum's and topic's slugs. forums/forum/FORUM_SLUG/ &rarr; forums/forum/ID/. forums/topic/TOPIC_SLUG/&rarr;forums/topic/ID/
* Author: Kolya Korobochkin
* Author URI: http://korobochkin.com/
* Version: 1.0.0
* Text Domain: bbpress_permalinks
* Domain Path: /languages/
/*
If you are using BP 2.1+, this will insert a Country selectbox.
Add the function to bp-custom.php and then visit .../wp-admin/users.php?page=bp-profile-setup
Remove this function after the field is created.
*/
function bp_add_custom_country_list() {
if ( !xprofile_get_field_id_from_name('Country') && 'bp-profile-setup' == $_GET['page'] ) {
@hdragomir
hdragomir / sm-annotated.html
Last active February 2, 2025 02:22
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@sergejmueller
sergejmueller / ttf2woff2.md
Last active March 9, 2024 13:37
WOFF 2.0 – Learn more about the next generation Web Font Format and convert TTF to WOFF2
@sbrajesh
sbrajesh / hide-user-on-directory.php
Last active August 29, 2015 14:00
Hide Logged in user on BuddyPress directory
add_filter('bp_ajax_querystring', 'devb_hide_user_on_directory', 15, 2);
function devb_hide_user_on_directory( $query_string, $object ){
if( !is_user_logged_in() )
return $query_string;
if( $object != 'members' || isset( $_REQUEST['search_terms'] ) && $_REQUEST['search_terms'] ) //updated to not hide from sarch
return $query_string;
@kloon
kloon / functions.php
Last active October 16, 2022 16:46
WooCommerce 2.1 variation price, revert to 2.0 format
/**
* Use WC 2.0 variable price format, now include sale price strikeout
*
* @param string $price
* @param object $product
* @return string
*/
function wc_wc20_variation_price_format( $price, $product ) {
// Main Price
$prices = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) );
@ntwb
ntwb / ntwb_bbpress_forum_icons.php
Created January 6, 2014 02:47
bbPress - Forum Icons
<?php
/*
Plugin Name: bbPress - Forum Icons
Plugin URI: https://gist.github.com/ntwb/8277457
Description: bbPress - bbPress - Forum Icons
Version: 0.1
Author: Stephen Edgar - Netweb
Author URI: http://netweb.com.au
*/