Skip to content

Instantly share code, notes, and snippets.

View johndavedecano's full-sized avatar
🏠
Working 🇳🇱

John Dave Decano johndavedecano

🏠
Working 🇳🇱
View GitHub Profile
import React from 'react'
import debounce from 'lodash/debounce'
import PT from 'prop-types'
class Slider extends React.Component {
static defaultProps = {
timeout: 3000,
autoPlay: true,
transition: 'ease',
@johndavedecano
johndavedecano / default.conf
Last active January 2, 2019 07:18
PHP 7.2 Laravel Nginx Basic Configuration
server {
listen 80 default_server;
listen [::]:80 default_server;
root /home/ubuntu/project/public;
index index.php index.html;
server_name _;
module.exports = {
"roots": [
"<rootDir>/src"
],
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
"moduleFileExtensions": [
"ts",
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Socialite;
use App\User;
@johndavedecano
johndavedecano / component.jsx
Last active October 17, 2018 15:17
Handle multiple requests with reactJS
import React from 'react'
import axios from 'axios'
export default class extend React.Component {
state = {
profile: {},
memes: {},
isLoaded: false,
isLoading: false
}
@johndavedecano
johndavedecano / LoginController.php
Created October 16, 2018 10:02
Auth/LoginController
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
class LoginController extends Controller
{
/*
@johndavedecano
johndavedecano / laravel-authentication.txt
Last active October 15, 2018 14:22
laravel authentication primer
Laravel Authentication Primer
1. Objective - to learn how to secure your web apps by adding authentication system with laravel framework.
2. Pre Requisite - Basic PHP or Laravel Knowledge
3. Introduction
- What is authentication?
- Different kinds of authentication.
- Session based
- Token Based
- Whats the difference between authorization and authentication?
@johndavedecano
johndavedecano / CalculatePostRating.php
Created October 12, 2018 12:56
Calculate Post Rating
<?php
namespace App\Jobs;
use App\Entities\Review;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
@johndavedecano
johndavedecano / laravel.xml
Created October 8, 2018 11:53
Laravel Coding Standard for PHP Storm
<code_scheme name="Laravel">
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="true" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
@johndavedecano
johndavedecano / jenkins-basics.txt
Created September 3, 2018 12:05
Jenkins Basics - Multibranch
1. Create groovy jenkins file
2. Setup credentials for docker hub and github
3. Create new job
4. Select Multibranch Pipeline
5. Select Branch Source
6. Select Repository
7. Select Jenkins File