Skip to content

Instantly share code, notes, and snippets.

@DZuz14
DZuz14 / Wally.php
Created March 20, 2018 13:25
Wally
/*
This is the method in my Service that calls Wally.
public function getWallData($exhibit, $wall) {
$criteria = craft()->elements->getCriteria(ElementType::Entry);
$criteria->section = $exhibit;
$response = $criteria->find();
$wally = new Wally();
return $wally->create($response[0], $wall);
}
@DZuz14
DZuz14 / progress-bar.js
Last active May 20, 2018 15:55
Progress Bar
<ProgressBar
containerStyles={{
border: '2px solid #323435',
width: '100%',
borderRadius: '0',
height: '16px'
}}
fillerStyles={{
background: '#FC585B'
}}
@DZuz14
DZuz14 / progress-bar-import.js
Created May 20, 2018 16:00
Progress Bar Imported Styles
import { myContainerStyles, myFillerStyles } from '../../some-directory/some-file'
<ProgressBar
containerStyles={myContainerStyles}
fillerStyles={myFillerStyles}
percentageDone={80}
/>
@DZuz14
DZuz14 / dotted-progress.js
Created May 20, 2018 16:41
Dotted Progress
<DottedProgress
numSteps={6}
activeStep={4}
activeDotColor="rgb(252, 88, 91)"
dotStyles={{
width: 20,
height: 20,
borderRadius: '0',
border: '1px solid #333'
}}
@DZuz14
DZuz14 / spinner.js
Last active May 20, 2018 16:52
Spinner With Height
<Spinner
height={75}
/>
@DZuz14
DZuz14 / file.php
Created June 22, 2018 01:40
Save Craft 3 Entry With PHP
<?php
$section = Craft::$app->sections->getSectionByHandle('journalArticles');
$entryTypes = $section->getEntryTypes();
$entryType = reset($entryTypes);
$entry = new Entry([
'sectionId' => $section->id,
'typeId' => $entryType->id,
'fieldLayoutId' => $entryType->fieldLayoutId,
@DZuz14
DZuz14 / Slide.js
Created July 29, 2018 00:32
Slide Component
import React from 'react'
const Slide = () => {
return <div className="slide"></div>
}
export default Slide
@DZuz14
DZuz14 / Slider.js
Last active July 29, 2018 01:28
Slider Updated With Child Components
import React, { Component } from 'react'
import Slide from '../slide'
import LeftArrow from '../left-arrow'
import RightArrow from '../right-arrow'
export default class Slider extends Component {
constructor(props) {
super(props)
this.state = {}
@DZuz14
DZuz14 / Slider.js
Last active July 29, 2018 02:01
Slider With Arrow Functionality Methods
import React, { Component } from 'react'
import Slide from '../slide'
import LeftArrow from '../left-arrow'
import RightArrow from '../right-arrow'
export default class Slider extends Component {
constructor(props) {
super(props)
this.state = {}
@DZuz14
DZuz14 / ArrowComponents.js
Created July 29, 2018 05:40
Arrows With Props
import React from 'react';
const RightArrow = (props) => {
return (
<div className="nextArrow" onClick={props.goToNextSlide}>
<i className="fa fa-arrow-right fa-2x" aria-hidden="true"></i>
</div>
);
}