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
<html> | |
<head> | |
</head> | |
<body> | |
<!-- the fact that this main block has an ID of #wrap has no actual bearing on this plugin --> | |
<div id="wrap">Main site content goes here, though the div doesn't | |
really have to close before footer begins. That doesn't matter either | |
way, which is what I think makes this solution so beautiful. | |
</div> | |
<footer>Copyright 2014</footer> |
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( $ ) | |
{ | |
/** | |
* @param obj - array of strings. The element name to be targeted | |
*/ | |
function addClasses( objArray ) | |
{ | |
for ( i = 0; i < objArray.length; i++ ) | |
{ | |
// Save CPU by storing this in local variable |
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
// Playground - noun: a place where people can play | |
import Cocoa | |
var i: Int = 0 | |
func power(#x :Int, #y :Int) -> Int { | |
if(y == 0) { | |
return 1; | |
} |
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 | |
function get_random_num( $start = 1, $finish = 2 ) | |
{ | |
static $rand; | |
if ( ! isset( $rand ) ) | |
{ | |
$rand = rand( $start, $finish ); | |
} | |
return $rand; |
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 | |
/** | |
* Having `display: inline-block` works great as long as there isn't white space. | |
*/ | |
add_filter('genesis_do_nav', 'remove_whitespace'); | |
function remove_whitespace( $str ) | |
{ | |
$str = str_replace( "\r\n", "", $str ); | |
$str = str_replace( "\r", "", $str ); |
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
/** | |
* centerVertically() takes a given DOM element and centers | |
* it vertically within the parent element. If the height | |
* of the browser is less than this element's height, then | |
* the original margin relative to top is restored until | |
* the window gets larger again. | |
* | |
* Note that this function extends the jQuery library and | |
* therefore requires it before this function can be | |
* defined. |
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
/** 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
<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 |