Skip to content

Instantly share code, notes, and snippets.

function crb_get_instagram_feed( $username, $slice = 9 ) {
$username = strtolower( $username );
$username = str_replace( '@', '', $username );
if ( false === ( $instagram = get_transient( 'instagram-a3-'.sanitize_title_with_dashes( $username ) ) ) ) {
$remote = wp_remote_get( 'http://instagram.com/'.trim( $username ) );
if ( is_wp_error( $remote ) )
function current_page_url() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {
$pageURL .= "s";
}
$pageURL .= "://";
if ( $_SERVER["SERVER_PORT"] != "80" ) {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {
$pageURL .= "s";
}
$pageURL .= "://";
if ( $_SERVER["SERVER_PORT"] != "80" ) {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
function timestamp_to_days_and_hours($time) {
$d = floor($time/86400);
$_d = $d;
$h = floor(($time-$d*86400)/3600);
$_h = ($h < 10 ? '0' : '').$h;
$m = floor(($time-($d*86400+$h*3600))/60);
$_m = ($m < 10 ? '0' : '').$m;
function crb_get_instagram_feed( $username, $slice = 9 ) {
$username = strtolower( $username );
$username = str_replace( '@', '', $username );
if ( false === ( $instagram = get_transient( 'instagram-a3-'.sanitize_title_with_dashes( $username ) ) ) ) {
$remote = wp_remote_get( 'http://instagram.com/'.trim( $username ) );
if ( is_wp_error( $remote ) )
<li class="cb-menu-item" ng-class="{ 'cb-menu-item-current': vm.isSegmentOpened() }" data-type="{{ vm.segment.type }}">
<a class="cb-menu-link" ng-href="vm.getSegmentHref()">
<span class="cb-segment-title">{{ vm.segment.title }}</span>
<i class="fa fa-chevron-left" ng-if="vm.segment.children.length"></i>
<span class="cb-menu-link-count">
<ng-pluralize count="vm.segment.children.length" when="vm.pluralizeRules"></ng-pluralize>
</span>
</a>
/**
* Renders a list of segments.
*
* @memberOf CourseBuilder.segments
* @fileOverview segments/components/segments/segments.directive.js
*/
;(function() {
'use strict';
function crb_get_instagram_feed( $username, $slice = 9 ) {
$username = strtolower( $username );
$username = str_replace( '@', '', $username );
if ( false === ( $instagram = get_transient( 'instagram-a3-'.sanitize_title_with_dashes( $username ) ) ) ) {
$remote = wp_remote_get( 'http://instagram.com/'.trim( $username ) );
if ( is_wp_error( $remote ) )
function ls_export_csv() {
// CSV file name
$csv_file_name = 'Locations_'.date('Y-m-d').'.csv';
$csv_header_array = array( "Name", "Street", "City", "State", "Zip Code", "Phone Number", "Website", "Email");
header("Content-type: application/csv"); # Declare the file type
header("Content-Transfer-Encoding: binary");
header("Content-Disposition: attachment; filename=".$csv_file_name); # Export the generated CSV File
header("Pragma: no-cache");
.comments h3 { padding-bottom: 20px; }
.comments li { list-style: none outside none; }
.comments li.comment { padding: 0 0 0 30px; margin: 0 0 20px 30px; border-left: 2px solid #4dbbf1; position: relative; }
.comments li .comment-author img { position: absolute; left: -26px; top: 20px; border-radius: 50%; }
.comments ul.children { padding-top: 20px; }
.comments .comment-reply { text-align: right; }
.comments form { max-width: 600px; margin: 0 auto; }
.comments form p { padding-bottom: 12px; }
.comments label { display: block; padding: 0 0 4px 20px; }
.comments input,