This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* By default you can rmeove a single user's admin bar in WordPress. | |
* That's cool but the problem of course is that you have to do this | |
* for every single user. If you are using software like Wishlist | |
* Member where new users are being added all the time, this is bad. | |
* The solution is to programmatically remove the admin bar accross | |
* the board. I've experimented doing this several ways and this is | |
* the best one in my expereince. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// LinkedList.c | |
// linked_lists | |
// | |
// Created by Martyn Chamberlin on 2/5/15. | |
// Copyright (c) 2015 Martyn Chamberlin. All rights reserved. | |
// | |
#include "LinkedList.h" | |
#include <iostream> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="wrap"> | |
<div class="left"> | |
<div class="box-container-outer"> | |
<div class="box-container"> | |
<div class="box"> | |
<div class="center-vertical">A</div> | |
</div> | |
</div> | |
</div> | |
Left Content Area |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** This file serves as a usage example **/ | |
angular.module("MyApp").controller("homeCtrl", ["$scope", "$rootScope", "UserService", homeCtrl]); | |
function homeCtrl($scope, $rootScope, UserService) { | |
UserService.GetUser().then(function(user) { | |
console.log( user.FirstName ); | |
}, function() { | |
console.log( 'An error occurred' ); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ConsoleApplication2 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
B myObj = new B(); | |
// comment the next line to disable parent constructor | |
myObj.Initialize(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$using_ssl = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' || $_SERVER['SERVER_PORT'] == 443; | |
add_action('wp', 'check_ssl'); | |
function check_ssl() | |
{ | |
// Page ID 2 must be https | |
if (is_page(2) && !$using_ssl) | |
{ | |
header('HTTP/1.1 301 Moved Permanently'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The problem | |
*/ | |
var A = true; | |
var B = true; | |
var C = false; | |
var D = false; | |
if ( A && B || C && ! D ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php session_start(); ?> | |
<form action="" method="post"> | |
<div> | |
<label>Old list name</label> | |
<input type="text" name="list_name" <?php if (isset($_SESSION['list_name'] )) echo 'value="' . $_SESSION['list_name'] . '"'; ?> | |
</div> | |
<div> | |
<label>New list name</label> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function( $ ) | |
{ | |
var i = 1; | |
$('nav li').each(function() | |
{ | |
$(this).addClass('item_' + i ); | |
i++; | |
}); | |
}); |