Skip to content

Instantly share code, notes, and snippets.

View bycassius's full-sized avatar
🧃
*sip*

CASSIUS bycassius

🧃
*sip*
  • Melbourne
  • 20:07 (UTC +10:00)
View GitHub Profile
@thomasgriffin
thomasgriffin / gist:9071378
Created February 18, 2014 13:52
Remove width and height attributes from images in Soliloquy sliders.
<?php
add_action( 'tgmsp_callback_start', 'tgm_soliloquy_remove_image_attr' );
function tgm_soliloquy_remove_image_attr( $id ) {
$script = 'var slides = $(slider).find(".soliloquy-slides > li img");';
$script .= '$(slides).each(function(i){';
$script .= '$(this).removeAttr("width height");';
$script .= '});';
echo $script;
@thomasgriffin
thomasgriffin / gist:9219422
Created February 25, 2014 22:35
Add the image title as a caption below the image in the gallery display.
<?php
add_filter( 'envira_gallery_output_after_link', 'tgm_envira_gallery_caption', 10, 5 );
/**
* Adds a caption below each image in the gallery.
*
* @since 1.0.0
*
* @param string $output String of gallery output.
* @param mixed $id The ID of the gallery.
* @param array $item Array of data about the image.
@thomasgriffin
thomasgriffin / gist:9606363
Created March 17, 2014 19:19
Remove Soliloquy boxes from everywhere except for the Soliloquy post type screen (v2).
<?php
add_action( 'add_meta_boxes', 'tgm_soliloquy_remove_metabox', 0 );
function tgm_soliloquy_remove_metabox() {
if ( ! class_exists( 'Soliloquy' ) ) {
return;
}
if ( empty( get_current_screen()->post_type ) || 'soliloquyv2' == get_current_screen()->post_type ) {
return;
@richardjortega
richardjortega / cubox-i4pro-setup.md
Last active August 29, 2015 14:04
CuBox i4-Pro - Debian Wheezy (Serial Only) with Ruby 2.1.2, Rails 4.1.2, Expanded FS,Networking

This tutorial assists users of the CuBox i4-Pro (using Freescale's iMX6 SoC) stand up a stable, serial-only version (no desktop/GUI) of Debian Wheezy with working Networking (Ethernet and WiFi) with Ruby/Rails. Information collected from various forum posts, blog posts, etc. Attribution added where I could remember. Using a Windows 8.1 machine, please provide comments for update regarding Mac/Linux tutorial translations (for the most part it shouldn't matter except for how you write ISOs to microSD cards).

Note: Relatively new at this level of Linux usage, if there are better ways to do something please mention in comments so I can update

Download Debian Wheezy ISO image

Note: The password for root is cubox-i on this linked Debian image

  • Download Debian Wheezy (may be updated in future) ISO image from Gunnar Wolf (Debian Developer) at http://people.debian.org/~gwolf/. You can use 7-zip to unpack an XZ file.
  • Alternatively, se
@neilkinnish
neilkinnish / about.json
Last active August 29, 2015 14:05
Example modules in Mixture, passing data to a reusable module....
{
"meta": {
"title": "About Us",
"subtitle": "Why we're different",
"description": "<p>Lorem ipsum nibh convallis malesuada nam pulvinar velit pulvinar dolor ante.</p><p>Sed sollicitudin id. Ornare ut laoreet morbi eros nibh tincidunt vitae metus. Consequat placerat lacinia eu at arcu. Mollis metus consectetuer blandit quisque commodo donec velit tincidunt vivamus nunc bibendum. Eu adipiscing tempor praesent aliquam. Sagittis pellentesque pretium nostra pellentesque sollicitudin.</p>",
"logo": {
"name": "Text for logo",
"image": "logo.jpg"
}
}
@GaryJones
GaryJones / functions.php
Created May 25, 2012 10:04 — forked from rogierborst/gist:2786753
Using the template_include filter in WordPress
<?php
add_filter( 'template_include', 'ja_template_include' );
/**
* Apply a template to all subcategories of a certain parent category.
*
* @author Rogier Borst
* @author Gary Jones
* @author Jared Atchison
*
* @link https://gist.github.com/gists/2787095 Current version
@GaryJones
GaryJones / functions.php
Last active December 10, 2015 01:18
WordPress: Add new featured image sizes.
<?php
// Add new featured image sizes
add_image_size( 'home-bottom', 150, 100, true );
add_image_size( 'home-top', 400, 200, true );
@digisavvy
digisavvy / Soliloquy Dynamic Slider
Last active December 19, 2015 01:48
This bit of code will generate a slider based on the post ID of the current page. Just drop this code into your template (functions.php, or elsewhere in your theme's files) and then upload files to your post (don't insert the images into the post, just upload them as attachments) and kaboom! Requires the Soliloquy Dynamic Slider Add-on (sold sep…
function add_image_to_content() {
global $post;
$dg_post_id = $post->ID;
if ( function_exists( 'soliloquy_dynamic' ) )
soliloquy_dynamic(
array( 'id' => "$dg_post_id"
) );
}
// The following are just action hooks and could be removed, if you're not hooking into anything specifically.
@brycejacobson
brycejacobson / soliloquy_dynamic_slider.php
Created September 4, 2013 19:36
Get the images attached to a post and make a Soliloquy Dynamic Slider.
<?php
//* Get images attached to post and make a slider
add_action( 'genesis_after_header', 'scw_gallery_slider', 2 );
function scw_gallery_slider() {
soliloquy_dynamic( array( 'id' => get_the_ID() ) );
}