Skip to content

Instantly share code, notes, and snippets.

Chris Chiera ChrisChiera

Block or report user

Report or block ChrisChiera

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ChrisChiera
ChrisChiera / iprestrictdomain.md
Created Feb 15, 2012
IP Restrict a Domain or Subdomain
View iprestrictdomain.md

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

View 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.
@ChrisChiera
ChrisChiera / delete_openwith_duplicates
Created Nov 13, 2012
Delete "Open With" Duplicate Entries on Mac
View delete_openwith_duplicates
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/\
LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local\
-domain system -domain user
killall Finder
@ChrisChiera
ChrisChiera / disable-wordpress-login
Created Aug 17, 2013
Disable WordPress User Login During Maintenance
View disable-wordpress-login
// 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 );
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; }
View add-class-on-scroll
jQuery(document).ready(function($) {
$(window).on('scroll touchmove', function () {
$('.main-navigation').toggleClass('past-main', $(document).scrollTop() > 0);
}).scroll();
});
@ChrisChiera
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
<?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);
}
You can’t perform that action at this time.