Skip to content

Instantly share code, notes, and snippets.


Chris Chiera ChrisChiera

View GitHub Profile
ChrisChiera / functions.php
Last active Aug 29, 2015 — forked from elimn/functions.php
MT | TEC | Change past event views to reverse chronological order
View functions.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);
View add-class-on-scroll
jQuery(document).ready(function($) {
$(window).on('scroll touchmove', function () {
$('.main-navigation').toggleClass('past-main', $(document).scrollTop() > 0);
View new_gist_file.css
.gform_wrapper ul {
padding-left: 0;
list-style: none; }
.gform_wrapper li {
margin-bottom: 15px; }
.gform_wrapper form {
margin-bottom: 0; }
ChrisChiera / disable-wordpress-login
Created Aug 17, 2013
Disable WordPress User Login During Maintenance
View disable-wordpress-login
//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_redirect( $logout_url, 302 );
ChrisChiera / delete_openwith_duplicates
Created Nov 13, 2012
Delete "Open With" Duplicate Entries on Mac
View delete_openwith_duplicates
LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local\
-domain system -domain user
killall Finder
View youtube-custom-player
A while back YouTube quietly removed their Custom Channel 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="" frameborder="0" allowfullscreen></iframe>
Replace ACCOUNT_NAME with your YouTube account.
ChrisChiera /
Created Feb 15, 2012
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