Skip to content

Instantly share code, notes, and snippets.

View acodesmith's full-sized avatar
💯

Adam Smith acodesmith

💯
View GitHub Profile
@acodesmith
acodesmith / web-safe-fonts.json
Created October 31, 2017 16:16
List of web safe fonts with font stack fallback options.
{
"Arial": {
"category": "sans-serif",
"stack": [
"Arial",
"Arial",
"Helvetica",
"\"Helvetica Neue\"",
"sans-serif"
]
@acodesmith
acodesmith / order_notes.php
Created August 25, 2017 15:48
Add Order Notes to all WooCommerce emails
<?php
function add_order_notes($order)
{
remove_filter('comments_clauses', array('WC_Comments', 'exclude_order_comments'));
$args = array(
'order' => 'DESC',
'approve' => 'approve',
'type' => 'order_note',
'post_id' => 4087
@acodesmith
acodesmith / wp-breadcrumb-home-info.php
Last active August 14, 2017 14:11
WordPress Breadcrumbs Data and HTML
<?php
/**
* @return object
*/
function get_breadcrumb_home()
{
return (object) [
'post_title' => __( 'Home', 'uncg-bryan' ),
'permalink' => site_url()
];
@acodesmith
acodesmith / console.js
Created December 22, 2016 16:49
Example of console
/**
* Custom Logger which only console logs to certain environment
*/
export default class Logger {
/**
* window.env var is set in the main yii2 layout
* If it's not set we default to prod
*/
constructor(options = {})
<?php
namespace app\components;
use Yii;
/**
* Class BaseModel
* @package app\models
* @property integer created
<?php
namespace app\components;
class Statuses {
/**
* ====================
* STATUS TYPES
* ====================
@acodesmith
acodesmith / webpack.example.config.js
Last active December 14, 2016 19:43
Example Webpack
//Webpack and NPM plugins
var webpack = require('webpack');
var glob = require("glob");
var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
//Folder Locations
var APP_DIR = path.resolve(__dirname, 'src');
var BUILD_DIR = path.resolve(__dirname, 'dist');
Template.restaurant.onCreated(function() {
let restaurantSub = this.subscribe( 'Restaurant', [ FlowRouter.getParam('restaurantId') ] )
, restaurantPromise = restaurantSub.readyPromise()
this.restaurant = new ReactiveVar()
this.ready = new ReactiveVar( false )
restaurantPromise.then(function(){
@acodesmith
acodesmith / spacing.scss
Created February 17, 2016 17:48
Standardize SCSS spacing extenders.
/**
* Variables
*/
$space: 20px !default;
$space-tiny: ($space / 4) !default; // ~5px
$space-small: ($space / 2) !default; // ~10px
$space-medium: ($space * 1.5) !default; // ~30px
$space-large: ($space * 2) !default; // ~40px
$space-huge: ($space * 3) !default; // ~60px
@acodesmith
acodesmith / example-tooltip-code.html
Last active December 13, 2015 19:08
Simple Javascript Tooltip object using html5 data-ui-tooltip attribute. View Demo: http://codepen.io/acodesmith/pen/ycoDE
<!--This is needed somewhere on the page-->
<!--The JS clones the item, so stack classes as needed-->
<div class="tooltipOuter">
<div class="tooltipInner"></div>
</div>
<!--Example-->
<div class="icon-help" data-ui-tooltip="Example Text in Tooltip. <br />Example Text on Second Line">?</div>