Skip to content

Instantly share code, notes, and snippets.

@cam5
cam5 / bp-custom.php
Created June 12, 2013 19:01
Link out the default ellipses that appear on forum updates in BuddyPress!
<?
class Better_Ellipses {
static $link;
static function init() {
add_action('bbp_new_reply', array(__CLASS__, 'get_reply_info'), 1, 2);
add_action('bbp_new_topic', array(__CLASS__, 'get_topic_info'), 1, 1);
add_filter('bp_excerpt_append_text', array(__CLASS__, 'link_ellipses') );
}
static function link_ellipses($string) {
return " <a href='" . self::$link . "'>[&hellip;]</a>";
@cam5
cam5 / single-product-reviews-excerpt.php
Created September 18, 2013 00:24
I used a few lines in the `single-product-reviews.php` woocommerce template to unhook jetpack on only product pages. Otherwise, it overrides the review form. Just calling the `Jetpack_Comments` class and removing those actions before the `comment_form()` was enough to selectively deactivate 'em. Note: your `single-product-reviews.php` might be i…
$jp = new Jetpack_Comments;
remove_action('comment_form_before', array($jp, 'comment_form_before'));
remove_action('comment_form_after', array($jp, 'comment_form_after'));`
comment_form( apply_filters( 'woocommerce_product_review_comment_form_args', $comment_form ) );
@cam5
cam5 / uikit-hooks.less
Created November 29, 2013 18:53
All the available hooks in uikit, as of Nov 2013
.hook-alert() {}
.hook-alert-success() {}
.hook-alert-warning() {}
.hook-alert-danger() {}
.hook-article-title() {}
.hook-article-meta() {}
.hook-article-lead() {}
.hook-article-divider() {}
.hook-badge() {}
.hook-badge-success() {}
<?php
$id_map = array();
$update = array();
$posts = $db->query("SELECT * from wp_posts");
for ($count = 1; $count <= $posts->num_rows; $count++) {
$row = $posts->fetch_assoc();
$id_map[$row['ID']] = $count;
@cam5
cam5 / dropkick.js
Created June 18, 2014 15:58
Resize a dropkick.js container to fit multiline selections
$('select').dropkick({
change: function(value, label) {
var lb = $('.dk_label:contains(' + label + ')'),
ct = lb.parents('.dk_container');
ct.css('height', lb.css('height'));
}
});

Keybase proof

I hereby claim:

  • I am cam5 on github.
  • I am cameronhurd (https://keybase.io/cameronhurd) on keybase.
  • I have a public key whose fingerprint is 5F9E 7497 89CA 536D B0C3 0589 53AF CFDF 3CA9 B798

To claim this, I am signing this object:

Verifying my Blockstack ID is secured with the address 14SiwJBwpgLUTV54HXFNdYF2Lii3LS6KrP https://explorer.blockstack.org/address/14SiwJBwpgLUTV54HXFNdYF2Lii3LS6KrP
{
"name": "smartweb-version-2",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "rm -rf dist && webpack --mode development --config webpack.server.config.js && webpack --mode development --config webpack.dev.config.js",
"start": "node ./server/app.js"
},
"engines": {
"node": ">= 8.0.0",