Skip to content

Instantly share code, notes, and snippets.

@brianjhanson
brianjhanson / simple-broswer.html
Last active December 13, 2015 17:18
A CodePen by Brian Hanson. Simple CSS Browser Chrome - Simple way to display a browser around images for my portfolio. Still trying to figure out a way to make it easier to use.
<div class="wrapper">
<h1>Single Element Simple Browser Chrome</h1>
<figure class="web">
<img src="http://placekitten.com/1000/600">
</figure>
</div><!-- end .wrapper -->
<?php
function the_date_range($args) {
global $post;
$default = array(
'start_field' => 'start_date',
'end_field' => null,
'base_format' => 'Ymd',
'post_id' => $post->ID,
'separator' => '<span class="date-separator">&ndash;</span>',
'month_format' => 'F',
// <?php the_field('partner_id', 'options'); ?> simply returns 100 which is set in a field in the back end.
<form class="ibanking-form" name="OAC" action="<?php echo get_field('ibanking_url', 'option'); ?>" method="post" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="id" value="<?php the_field('vendor_id', 'options'); ?>">
<input type="hidden" name="ResetDGM" value="true">
<input type="hidden" name="prodid" value="<?php the_sub_field('apply_product_id'); ?>">
<?php if( get_field('partner_id', 'options') ) : ?>
<input type="hidden" name="partid" value="<?php the_field('partner_id', 'options'); ?>">
<?php endif; ?>
<a onclick="get_form(this).submit(); return false" class="btn btn--home-apply <?php if(get_sub_field('btn_xlarge')) echo " btn--xlarge "; ?> <?php if(get_sub_field('button_style')) the_sub_field('button_style'); ?> btn--submit <?php if(get_sub_field('no_padding')) echo " btn--submit--no-padding "; ?> ">Apply Now</a>
@brianjhanson
brianjhanson / Guidelines
Last active August 29, 2015 14:14
CSS At ODC
# CSS at ODC
This is an attempt to start nailing down our CSS methodology at ODC. I feel like we follow it pretty closely, but I wanted to open up a discussion and start tying to document it.
- Mix of BEM and SMACSS methodology (mostly BEM for naming but with the h, l, to indicate type)
I'm taking a lot of this from [Hugo Giraudel's Sass Guidelines](http://sass-guidelin.es/) but feel it's worth writing out specifically which rules we prefer.
## Basic Syntax & Formatting
- roughly 80 character line lengths
@brianjhanson
brianjhanson / SassMeister-input.scss
Created April 22, 2015 16:19
Generated by SassMeister.com.
// ----
// libsass (v3.1.0)
// ----
$spacings: (
small: rem(12),
base: rem(24),
medium: rem(32),
large: rem(48),
xlarge: rem(72),
@brianjhanson
brianjhanson / SassMeister-input.scss
Last active August 29, 2015 14:19
Generated by SassMeister.com.
// ----
// libsass (v3.1.0)
// ----
$spacings: (
small: rem(12),
base: rem(24),
medium: rem(32),
large: rem(48),
xlarge: rem(72),
/* ==============================================================
Text
============================================================== */
//---------------------------------------------------------------
// Base
//---------------------------------------------------------------
@brianjhanson
brianjhanson / SassMeister-input.scss
Created August 25, 2015 21:38
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$spacing: (
xs: 2.5rem,
s: 4rem,
m: 6rem,
l: 8rem,
xl: 10rem
@brianjhanson
brianjhanson / profile-summary-firebug.php
Last active November 29, 2016 23:08
More useful output of craft profiling console
<script type="text/javascript">
/*<![CDATA[*/
if (typeof(console) == 'object' && typeof console.groupCollapsed == 'function')
{
console.groupCollapsed("Profiling Summary Report");
console.log("Time: <?php echo sprintf('%0.5f', Craft\Craft::getLogger()->getExecutionTime()); ?>s\n");
console.log("Memory: <?php echo number_format(Craft\Craft::getLogger()->getMemoryUsage() / 1024); ?>Kb\n");
console.log("Total Queries: <?php echo is_array($data) ? count($data) : '0'; ?>\n");
<?php
@brianjhanson
brianjhanson / Craft3ValetDriver.php
Created June 2, 2017 02:53
Valet Driver for Craft 3
<?php
class Craft3ValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri