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
/** | |
* 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 = {}) |
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 | |
namespace app\components; | |
use Yii; | |
/** | |
* Class BaseModel | |
* @package app\models | |
* @property integer created |
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 | |
namespace app\components; | |
class Statuses { | |
/** | |
* ==================== | |
* STATUS TYPES | |
* ==================== |
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
//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'); |
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 | |
/** | |
* @return \yii\db\ActiveQuery | |
*/ | |
public function getProduct_variants() | |
{ | |
return $this->hasMany(ProductVariants::className(), ['product_id' => 'id'])->andWhere(['<>','product_variants.status', Statuses::STATUS_REMOVED]); | |
} | |
/** |
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
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(){ | |
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
/** | |
* 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 |
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
$directions: right, left; | |
$sizes: xs, sm, md, lg; | |
@each $direction in $directions { | |
@each $size in $sizes { | |
.pull-#{$direction}-#{$size}{ | |
@if($size == xs){ | |
@media (min-width: $screen-xs-min) { |
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
add_shortcode('srcset', 'srcset_func'); | |
function srcset_func($attr) | |
{ | |
$images = array(); | |
foreach(get_intermediate_image_sizes() as $size){ | |
$images[] = wp_get_attachment_image_src($attr['attachment_id'], $size); | |
} | |
$srcset = ''; $count = 0; |