Skip to content

Instantly share code, notes, and snippets.

View chrisvogt's full-sized avatar
🌸
✿◕‿◕

Chris Vogt chrisvogt

🌸
✿◕‿◕
View GitHub Profile
@chrisvogt
chrisvogt / unsupported-browser.html
Created October 28, 2012 07:01
Unsupported browser alert bar
<!-- pulled from the heart of Github -->
<div id="unsupported-browser">
<div class="container clearfix">
<a href="https://help.github.com/articles/supported-browsers" class="button classy">Learn More</a>
<h5>Please note that GitHub no longer supports Internet Explorer versions 7 or 8.</h5>
<p>We recommend upgrading to <a href="http://ie.microsoft.com/">Internet Explorer 9</a>, <a href="http://chrome.google.com">Google Chrome</a>, or <a href="http://mozilla.org/firefox/">Firefox</a>.</p>
</div>
</div>
@chrisvogt
chrisvogt / skillsquares.sql
Last active December 10, 2015 09:38
Define foreign keys and add providers table.
-- -----------------------------------------------------
-- Table `skillsquares`.`providers`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `skillsquares`.`providers` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT ,
`name` VARCHAR(150) NULL DEFAULT NULL ,
`url` VARCHAR(255) NULL DEFAULT NULL ,
`description` TEXT NULL DEFAULT NULL ,
`is_active` TINYINT(1) NULL DEFAULT '1' ,
`created` DATETIME NULL DEFAULT NULL ,
@chrisvogt
chrisvogt / cakephp-debug.php
Created January 16, 2013 20:02
CakePHP debug
################################################################################
// DEBUGGING
################################################################################
#ppr($_SESSION);
#echo "".__FILE__.":".__FUNCTION__.":".__LINE__." - <strong>I am here.</strong> <br />";
#die('<strong>The action was halted early, halt!</strong>');
################################################################################
@chrisvogt
chrisvogt / pae-schedule-sso.php
Last active December 12, 2015 08:49
Interact with PAE SSO API and frame the scheduling system.
<?php
/**
* Request SSO token from Pan Am Education.
*
* https://panameducation.com/app/sso/token?api_login=__API-LOGIN__&api_password=__API-PASSWORD__&email=__STUDENT-EMAIL__
*/
## Set the query string values
$values = array(
'api_login' => $pae['api_login'],
@chrisvogt
chrisvogt / cake-load.php
Created March 7, 2013 17:33
If you have multiple Cake plugins to load, this is the format for your bootstrap.php file.
CakePlugin::loadAll(array(
'Users' => array('routes' => true),
'AclManager' => array('bootstrap' => true),
'Recaptcha' => array('bootstrap' => true)
));
@chrisvogt
chrisvogt / php-comment-style-guide.php
Created March 9, 2013 22:22
A PHP comment style guide.
<?php // app/controllers/really_awesome_controller.php
/**
* Awesome Controller Name
*
* This does something really awesome, and nifty too!
*
* @package CakePHP
* @subpackage Super-Cool-Application
* @author Chris Vogt (chris@example.com)
* @since 1.1.4
@chrisvogt
chrisvogt / autoSizeIframeHeight.js
Created April 12, 2013 21:02
Adjust scheduling iframe
function autoSizeIframeHeight(iframe, header, minHeight) {
minHeight = minHeight || 300;
function getViewportHeight() {
var h = document.documentElement.clientHeight;
return document.compatMode === "CSS1Compat" && h || document.body.clientHeight || h;
}
function getHeaderHeight() {
return parseFloat(getComputedStyle(header,'height'));
}
function getComputedStyle(el, cssprop){
@chrisvogt
chrisvogt / af-sendy-default.php
Created April 17, 2013 03:36
Sendy on AppFog default config.
<?php
//==================================================================================//
// Configuration
//==================================================================================//
//path to your Sendy installation (without the trailing slash)
define('APP_PATH', 'http://sendy.yourdomain.com');
## --- APPFOG --- ##
@chrisvogt
chrisvogt / cake-user-language.php
Last active December 16, 2015 10:49
A stab at user language localization by `User.user_lang`, a passed query param, or a stored session variable. This belongs in your AppController and should be called from the beforeFilter() method.
<?php
/**
* Language Handler.
*
* Sets the app's configured language based on passed parameter or language
* configuration stored in session variable.
*
* @author C1V0
*/
protected function _langHandler() {
@chrisvogt
chrisvogt / wordpress-clean-header.php
Created April 25, 2013 19:10
Cleans up the Wordpress header
<?php
// Clean up the wordpress header by filtering out the following items from WP_HEAD():
function NAMESPACE_header_cleanup() {
// Really Simple Discovery
remove_action('wp_head', 'rsd_link');
// Windows Live Writer
remove_action('wp_head', 'wlwmanifest_link');