Skip to content

Instantly share code, notes, and snippets.

Daniel Zuzevich DZuz14

Block or report user

Report or block DZuz14

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View script.php
// 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 Jan 29, 2017
Start of the higher order component
View Slider.js
import React, { Component } from 'react';
export default class Slider extends Component {
constructor(props) {
super(props);
this.state = {}
}
render() {
@DZuz14
DZuz14 / SlideThree.js
Created Jan 29, 2017
One of the three slides in the slider.
View SlideThree.js
import React, { Component } from 'react';
const SlideThree= (props) => {
return <div className="slide"></div>
}
export default SlideThree;
@DZuz14
DZuz14 / Slider.js
Created Jan 29, 2017
Slider with conditionals added
View Slider.js
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 Jan 29, 2017
One of the slide components with a background image added
View SlideThreeWithImage.js
import React, { Component } from 'react';
const SlideThree= (props) => {
let background = {
backgroundImage: 'url(aurora.jpg)',
backgroundSize: 'cover',
backgroundPosition: 'center'
}
View SliderWithFunctionsAdded.js
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);
View ArrowClickHandlers.js
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
Java Module that communicates JS with Native Android AlarmManager
View AlarmManagerModule.js
// 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
React Native Component
View AddAlarm.js
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 Jun 22, 2017
Retrieve A Cookie With Javascript
View getCookie.js
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)
}
You can’t perform that action at this time.