Skip to content

Instantly share code, notes, and snippets.

View vfowler's full-sized avatar

Vernon Fowler vfowler

View GitHub Profile
Seven different types of CSS attribute selectors
// This attribute exists on the element
[value]
// This attribute has a specific value of cool
[value='cool']
// This attribute value contains the word cool somewhere in it
[value*='cool']
$(function() {
var topoffset = 70; //variable for menu height
//Use smooth scrolling when clicking on navigation
$('.navbar-nav a').click(function() {
if (location.pathname.replace(/^\//,'') ===
this.pathname.replace(/^\//,'') &&
location.hostname === this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
@maban
maban / Event Notes.md
Last active March 9, 2020 19:28
Event Notes

Event Notes

  • Event Name:
  • Location:
  • Date:
  • Conference format: (number of days, tracks, and speakers)

Talk

@pmeenan
pmeenan / user-timing-rum.js
Last active January 18, 2024 23:46
Support routine for adding W3C user timing events to a site. Includes some basic polyfill support for browsers that don't support user timing or navigation timing (though the start time for non-navigation timing support could be improved with IE < 9 to use IE's custom start event).
// Support routines for automatically reporting user timing for common analytics platforms
// Currently supports Google Analytics, Boomerang and SOASTA mPulse
// In the case of boomerang, you will need to map the event names you want reported
// to timer names (for mPulse these need to be custom0, custom1, etc) using a global variable:
// rumMapping = {'aft': 'custom0'};
(function() {
var wtt = function(n, t, b) {
t = Math.round(t);
if (t >= 0 && t < 3600000) {
// Google Analytics
@BronsonQuick
BronsonQuick / change_buddypress_group_slugs_from_groups_to_teams.php
Created May 29, 2013 00:14
Change BuddyPress Group Slugs from Groups to "Teams"
<?php
/* Added to functions.php in the theme */
function ts_change_groups_slug(){
global $bp;
$bp->groups->root_slug = 'teams';
return $bp->groups->root_slug;
}
add_filter( 'bp_get_groups_slug', 'ts_change_groups_slug' );
add_filter( 'bp_get_groups_root_slug', 'ts_change_groups_slug' );
<?php
function pg_config_achievement_post_type( $settings ) {
$settings['menu_icon'] = ''; // url here
return $settings;
}
add_filter( 'dpa_register_post_type_achievement', 'pg_config_achievement_post_type' );
Object Caching: APC / Memcached
Page Caching: Batcache
APC: http://wordpress.org/extend/plugins/apc/
Memcached: http://wordpress.org/extend/plugins/memcached/
Batcache: http://wordpress.org/extend/plugins/batcache/
Remember, these require server-side components or libraries; ask your host for advice before installing these plugins if you're not sure.
@imath
imath / functions-avatar.php
Created March 4, 2013 16:03
A BuddyPress trick in reply to http://buddypress.org/support/topic/display-only-members-who-have-uploaded-avatar/ : the goal is to only loop through the members who actually uploaded an avatar (instead of using gravatar). !important Make sure to backup your db before running init_evo_meta(). Once init_evo_meta() ran, make sure to delete it and l…
<?php
/************* beginning of the code to paste in the functions.php of the active theme *************/
/*
the function to to display only the users that actually uploaded an avatar
see http://buddypress.org/support/topic/display-only-members-who-have-uploaded-avatar/
*/
function evo_list_uploaded_avatars(){
@jonathantneal
jonathantneal / README.md
Created November 8, 2012 09:33
Accessible Breadcrumbs Markup

Accessible Breadcrumbs Markup

Screen Readers

On MacOS X Mountain Lion, VoiceOver 6 reads "Breadcrumbs with 3 items, navigation. Link, Home. Link, Library. Visited link, Data."

On Windows XP, Windows Eyes 7.5.4.1 reads "Two links. Link, Home. Link, Library. Visited Link, Data."

On Windows XP, NVDA 2012.3 reads "Navigation landmark. Link, Home. Link, Library. Visited Link, Data."