Skip to content

Instantly share code, notes, and snippets.

View buddyeorl's full-sized avatar

Alex Lizarraga buddyeorl

View GitHub Profile
import React from 'react';
import SlideOnLoad from '../PathToSlideOnLoad;
//wrap your component inside the SlideOnLoad component to see the effect on load
//SlideOnLoad props:
//direction: enum string<= options: 'up', 'down','left','right','custom'
//end:string in pixels e.g. 20px, //required
//start:string in pixels e.g. 20px, //optional, only required for when direction is custom
const Example=()=>{
return(
import React from 'react';
import Typing from '../PathToTyping';
//Typing props:
//label: array of strings
//showCursor:boolean <= shows cursor blinking effect when typing is completed
//cb: function <= callback function that triggers when typing is completed
const Example=()=>{
return(
<div style={{ width: '200px' }}>
import { useState, useLayoutEffect } from 'react'
function useWindowSize() {
const [size, setSize] = useState([0, 0]);
useLayoutEffect(() => {
updateSize()=> {
setSize([window.innerWidth, window.innerHeight, window.pageYOffset]);
}
window.addEventListener('resize', updateSize);
updateSize();
const shortProjects={
//... Project info here
}
// add navigation:{back, forward} property to shortProjects object, the navigation are the urls to be used on the prev and next button in the ProjectPage component,
// by default the navigation will be added based in the order of project objects above:
Object.keys(shortProjects).reduceRight((cur, prev, index) => {
if (shortProjects[cur].navigation) {
shortProjects[cur].navigation.back = '/projects/' + prev;
@buddyeorl
buddyeorl / setup.js
Last active October 13, 2020 03:26
Setup for project portfolio
//THE CONTENT IN THIS FILE WILL BE USED TO RENDER THE PROJECTS IN THE PROJECT SECTION ALONG WITH THE PROJECT DATA ITSELF
import SearchBar from '../ProjectComponents/SearchBar'
// the key used for the property should be the same used as the last part in the url,
//INCORRECT SETUP:
// 'brands-api':{
// url:'/projects/brandsApi', <====INCORRECT SETUP
// ... more keys here
// }
import React from 'react';
import MovingLabel from '../PathToMovingLabel';
// Moving Label props:
// message: component,
// follow: boolean => if true, component will move around the div, if false, it will only move around its axis
// angle: angle of rotation
const Example=()=>{
return(
import React from 'react';
import MovingLabel from '../PathToMovingLabel';
//Moving Label props:
// message: component,
// follow: boolean => if true, component will move around the div, if false, it will only move around its axis
const Example=()=>{
return(
<div style={{ height: '500px', width: '100%', boxShadow: '-1px 2px 4px -2px', borderRadius: '10px', margin: '10px', display: 'flex', justifyContent: 'center' }}>
import React from 'react';
import MagneticMouse from '../PathToMagneticMouse';
//MagneticMouse also accepts a img props which is the url of an image
const Example=()=>{
return(
<div style={{ height: '500px', width: '100%', boxShadow: '-1px 2px 4px -2px', borderRadius: '10px', margin: '10px', display: 'flex', justifyContent: 'center' }}>
<MagneticMouse myBackground={'Hi this is a sample message'} />
</div>
const jwt = require('jsonwebtoken');
const User = require('mongoose').model('User');
const Task = require('mongoose').model('Task');
const config = require('../../config');
/**
* The Auth Checker middleware function.
*/
module.exports = (req, res, next) => {
import React from 'react';
import Auth from '../../modules/Auth';
import Dashboard from '../../components/Dashboard';
import SideBar from '../../components/SideBar';
import TopBar from '../../components/TopBar';
class DashboardPage extends React.Component {
constructor(props) {
super(props);