Skip to content

Instantly share code, notes, and snippets.

View TechRemarker's full-sized avatar

TM TechRemarker

  • Greater Boston
View GitHub Profile
@TechRemarker
TechRemarker / functions.php
Last active August 29, 2015 14:27 — forked from elimn/functions.php
MT | TEC | Change past event views to reverse chronological order
<?php
// Changes past event views to reverse chronological order
function tribe_past_reverse_chronological ($post_object) {
$past_ajax = (defined( 'DOING_AJAX' ) && DOING_AJAX && $_REQUEST['tribe_event_display'] === 'past') ? true : false;
if(tribe_is_past() || $past_ajax) {
$post_object = array_reverse($post_object);
}
@TechRemarker
TechRemarker / add-class-on-scroll
Created March 30, 2015 20:44
Add Class on Scroll
jQuery(document).ready(function($) {
$(window).on('scroll touchmove', function () {
$('.main-navigation').toggleClass('past-main', $(document).scrollTop() > 0);
}).scroll();
});
.gform_wrapper ul {
padding-left: 0;
list-style: none; }
.gform_wrapper li {
margin-bottom: 15px; }
.gform_wrapper form {
margin-bottom: 0; }
@TechRemarker
TechRemarker / disable-wordpress-login
Created August 17, 2013 16:41
Disable WordPress User Login During Maintenance
// MAINTAINANCE MODE
//Disables login for 'editor' and custom 'revisor' user roles.
function site_maintenance() {
if ( current_user_can('editor') || current_user_can('revisor') ) {
$logout_url = wp_login_url().'?mode=maintainance';
wp_logout();
wp_redirect( $logout_url, 302 );
@TechRemarker
TechRemarker / delete_openwith_duplicates
Created November 13, 2012 20:36
Delete "Open With" Duplicate Entries on Mac
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/\
LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local\
-domain system -domain user
killall Finder
@TechRemarker
TechRemarker / youtube-custom-player
Created March 27, 2012 19:01
YouTube Custom Player
A while back YouTube quietly removed their Custom Channel Player, http://youtube.com/custom_player leaving users no way to automatically show their Channel in an embed other than manually curating a Playlist which was limited to a number of videos.
The Google Gadget option was limited in its inability to change width and height attributes.
The following code will now show a Custom Channel embed as expected:
<iframe width="560" height="315" src="http://www.youtube.com/embed/?listType=user_uploads&list=ACCOUNT_NAME" frameborder="0" allowfullscreen></iframe>
Replace ACCOUNT_NAME with your YouTube account.
@TechRemarker
TechRemarker / iprestrictdomain.md
Created February 15, 2012 00:19
IP Restrict a Domain or Subdomain

IP Restrict a Domain or Subdomain

Create a .htaccess file. (they are hidden by default)

Add the following contents:

Deny from all Allow from 0.0.0.0.0