Skip to content

Instantly share code, notes, and snippets.

@DZuz14
DZuz14 / script.php
Created December 15, 2016 19:58
Zen dropdown
// The below command is creating a variable that loads the 'departures' template, and loads its children.
// I am curious as to where the date is getting it's instructions on how to display itself.
// Hoping you can shed some light onto the subject.
$departures = $page->get('template=departures')->children('template=departure');
<div class="ctaBox-departure">
<label for="departure">
<?=__('Departure Date')?>: </label>
<select name="departure">
@DZuz14
DZuz14 / Slider.js
Created January 29, 2017 04:30
Start of the higher order component
import React, { Component } from 'react';
export default class Slider extends Component {
constructor(props) {
super(props);
this.state = {}
}
render() {
@DZuz14
DZuz14 / SlideThree.js
Created January 29, 2017 04:31
One of the three slides in the slider.
import React, { Component } from 'react';
const SlideThree= (props) => {
return <div className="slide"></div>
}
export default SlideThree;
@DZuz14
DZuz14 / Slider.js
Created January 29, 2017 04:35
Slider with conditionals added
import React, { Component } from 'react';
import SlideOne from './SlideOne';
import SlideTwo from './SlideTwo';
import SlideThree from './SlideThree';
export default class Slider extends Component {
constructor(props) {
super(props);
this.state = {
@DZuz14
DZuz14 / SlideThreeWithImage.js
Last active January 29, 2017 04:38
One of the slide components with a background image added
import React, { Component } from 'react';
const SlideThree= (props) => {
let background = {
backgroundImage: 'url(aurora.jpg)',
backgroundSize: 'cover',
backgroundPosition: 'center'
}
import React, { Component } from 'react';
import SlideOne from './SlideOne';
import SlideTwo from './SlideTwo';
import SlideThree from './SlideThree';
import RightArrow from './RightArrow';
import LeftArrow from './LeftArrow';
export default class Slider extends Component {
constructor(props) {
super(props);
import React, { Component } from 'react';
const RightArrow = (props) => {
return (
<div onClick={props.nextSlide} className="nextArrow">
<i className="fa fa-arrow-right fa-2x" aria-hidden="true"></i>
</div>
);
}
@DZuz14
DZuz14 / AlarmManagerModule.js
Created May 31, 2017 19:47
Java Module that communicates JS with Native Android AlarmManager
// Android & Java
import android.widget.Toast;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.content.Context;
import java.util.Calendar;
// React
import com.facebook.react.bridge.NativeModule;
@DZuz14
DZuz14 / AddAlarm.js
Last active May 31, 2017 20:29
React Native Component
import React, { Component } from 'react'
import { View, Text, Switch, NativeModules, AsyncStorage } from 'react-native'
import { Slider, Button, FormLabel, FormInput } from 'react-native-elements'
import { medgrey, darkgrey, green, white } from '../utils'
// Java Bridge Component to Native AlarmManager API
const AlarmManager = NativeModules.AlarmManager
export default class AddAlarm extends Component {
constructor(props) {
@DZuz14
DZuz14 / getCookie.js
Created June 22, 2017 12:21
Retrieve A Cookie With Javascript
function getCookie(cookieName) {
var name = cookieName + '='
var arr = document.cookie.split(';')
for (var i = 0; i < arr.length; i++) {
var str = arr[i]
while (str.charAt(0) === ' ') {
str = str.substring(1)
}