Skip to content

Instantly share code, notes, and snippets.

View joshdcomp's full-sized avatar

Josh Compton joshdcomp

View GitHub Profile
<div class="container content">
<?php
$devices_table = get_device_overview_data();
build_device_table($devices_table);
?>
</div> <!-- .cotnainer.content -->
//or, more significantly:
@joshdcomp
joshdcomp / index.html
Created March 29, 2013 16:54
A CodePen by compto35.
<article>:D</article>
@joshdcomp
joshdcomp / Column generator.
Last active December 15, 2015 18:29
You define your own columns and gutters, this builds your widths out for you
//Doing columns better thant the Greeks OR the Romans
// There are no required variables, but someone can pass how many columns in the
// grid (that they can optionally determine with columnPX and gutterPX) they want
// an element to span. This means we can generate infinite grid systems with one mixin.
@mixin grid_builder($colSpan: 6, $columnPx: 73, $gutterPx: 15){
//Calculate the width of the element
$elementWidth: ($columnPx * $colSpan) + ($gutterPx * ($colSpan - 1));
//inline-block to preserve the height in the browser
@joshdcomp
joshdcomp / Shame Rules
Created April 22, 2013 15:51
Rules of shame
// -----------------------------------------------------------------------------
/* Shame CSS */
// This is not a dumping ground. It is a staging area for hacks that are
// intended to be fixed and resolved so as not to sully our
// production-ready codebase. Hacks are necessary, but they are not
// permanent, nor are they acceptable long-term. You are not done when
// you've moved your selector and rules here.
// This is not intended to be an easy fix, or a simple way out. You will
// spend time writing out your shame, and you will make it known that
@joshdcomp
joshdcomp / Is this dirtty
Last active December 16, 2015 19:19
Utility snippet for a group of accordions parsing an array to determine the classnames the accordion container should receive.
$parentString = '';
$parentString .= ( $menu['is_current'] )
? 'is_current '
: '';
$parentString .= empty( $subMenu )
? ''
: 'is_parent ';
@joshdcomp
joshdcomp / faq.html
Last active December 17, 2015 09:09
How definition lists /should/ be marked up
<dl>
<div class="li">
<dt>FA Question</dt>
<dd>Definition here</dd>
</div>
</dl>
@joshdcomp
joshdcomp / cmd.shift.click.js
Last active December 17, 2015 16:38
Capturing a shift+cmd+click event and doing stuff
/**
* Functionality for capturing a command + shift + click
* Note: does not work for the key you have mapped for context menu
*/
var cmdShiftClick = {
//set an object property for holding shift
isShift : false,
//set another for holding command or control
isCtrl : false,
init : function(){
@joshdcomp
joshdcomp / custom-slider.html
Last active December 18, 2015 10:19
Custom double-wide slider yo
<div class="modal_form_field modal_provision_cores double_wide" style="display: block;">
<h4 class="label" data-for="provision_cores">Cores: <span>22</span></h4>
<h4 class="label" data-for="provision_ram">RAM: <span>22</span></h4>
<div class="provision_cores slide_input" id="provision_cores" data-min="1" data-max="11" data-step="1" data-value="1">
<div class="fill_line"></div>
<div class="slide_input_cursor" style="margin-left: 190px;"></div>
</div>
<div class="provision_ram slide_input" id="provision_ram" data-min="2" data-max="22" data-step="2" data-value="2">
// I'm talking something like this:
if( !get_option() ) echo 'hello';
// There's no option value, but it doesn't echo hello becuase the return value isn't false.
// In order to echo hello, I have to write something akin to:
if( get_option() != '' ) echo 'hello';
$('.notification_queue').on(
{
mouseenter: function(e){
tooltipHandler.toggle(e);
},
mouseleave: function(e){
tooltipHandler.toggle(e);
}
},
'.notification_actions i'