Skip to content

Instantly share code, notes, and snippets.

View kopepasah's full-sized avatar
🤖
Solving problems with bots.

Justin Kopepasah kopepasah

🤖
Solving problems with bots.
View GitHub Profile
get_time_difference( $comment->comment_date );
@kopepasah
kopepasah / header.phtml
Created March 3, 2014 13:26
Template code and information for Expatriate documentation.
<?php
/**
* The Header for Expatriate.
*
* Displays all of the <head> section and
* everything up till <div id="content">
*
* @package expatriate
* @author kopepasah
* @since 1.0.0
<?php
// Add this action, ignore the opening <?php tag and this comment.
add_action( 'expat_enable_minified_styles', '__return_true' );
/** -----------------------------------------------------:[ structure ]:---------- */
=== some code
/** -----------------------------------------------------:[ general ]:---------- */
=== some code
/** -----------------------------------------------------:[ header ]:---------- */
=== some code
@kopepasah
kopepasah / find.txt
Created March 11, 2014 11:33
Use TextMate to find and replace all tabbed lines with empty lines.
[\t]+[\n]
@kopepasah
kopepasah / add-submodule.bash
Last active August 29, 2015 13:57
This Gist contains code for my 'Easily Add Less CSS Pre-Processor to any WordPress Theme' tutorial on kopepasah.com.
git submodule add git@github.com:kopepasah/wp-theme-toolkit-less.git lib/less
@kopepasah
kopepasah / available-modules.php
Last active August 29, 2015 13:57
One line conditional to check if a Jetpack module is active or not.
Jetpack::get_available_modules();
Array
0 => after-the-deadline
1 => carousel
2 => comments
3 => contact-form
4 => custom-css
5 => enhanced-distribution
6 => gplus-authorship
<?php
// Enqueuing and Using Custom Javascript/jQuery
function custom_load_custom_scripts() {
if ( file_exists( get_stylesheet_directory() . '/js/custom_jquery_additions.js' ) ) {
$url = get_stylesheet_directory_uri() . '/js/custom_jquery_additions.js';
} else if ( file_exists( get_template_directory() . '/js/custom_jquery_additions.js' ) ) {
$url = get_template_directory_uri() . '/js/custom_jquery_additions.js';
}
@kopepasah
kopepasah / description.md
Last active August 29, 2015 13:58
Custom Thumbnail Pagination on SlidesJS:

Custom Thumbnails on Slidesjs Pagination

Out of the box, SlidesJS does not provide the ability to add custom pagination. Although I love slides (it's my go-to for simple sliders), on a recent project I needed to ability to have small thumbnails for pagination.

With the simple addition of two attributes to the images and code the loaded callback for Slides, thumbnail pagination is possible (and simple).

A Pen by Kopepasah on CodePen.

License.

@kopepasah
kopepasah / entypo.css
Created April 18, 2014 14:26
Less code for web font version of Entypo (also includes the CSS output).
@font-face {
font-family: 'Entypo';
src: url('entypo.eot');
src: url('entypo.eot?#iefix') format('embedded-opentype'), url('entypo.woff') format('woff'), url('entypo.ttf') format('truetype'), url('entypo.svg#EntypoRegular') format('svg');
font-weight: normal;
font-style: normal;
}
.entypo {
display: inline-block;
font-family: Entypo;