Skip to content

Instantly share code, notes, and snippets.

import Echo from 'laravel-echo';
import Pusher from 'pusher-js';
export const pusher = Pusher;
export const config = authToken => ({
broadcaster: 'pusher',
key: 'myKey',
wsHost: location.hostname,
wsPort: 6001,
const HtmlWebpackPluginConfig = new HtmlWebpackPlugin({
template: `!!raw-loader!${path.join(__dirname, 'client/index.ejs')}`,
filename: path.resolve(__dirname, './server/templates/index.ejs'),
inject: 'body',
});
import React, { Component } from 'react'
import { menuSettings } from '../Navigation'
import map from 'lodash/map'
import jump from 'jump.js'
export default class StickyNavigation extends Component {
scroller(name, e) {
e.preventDefault()
jump(e.currentTarget.attributes.href.value)
}
@jdltechworks
jdltechworks / mapping
Last active September 3, 2019 07:33
Kabuang na Seeing pattern
'use strict'
/*
|--------------------------------------------------------------------------
| SpaceCategorySeeder
|--------------------------------------------------------------------------
|
| Make use of the Factory instance to seed database with dummy data or
| make use of Lucid models directly.
|
import React, { createContext, useReducer, useEffect, useCallback } from 'react'
import storage from '@react-native-community/async-storage'
import authReducer from 'resources/reducers/auth'
export const AuthContext = createContext({})
const AuthProvider = ({ children }) => {
const [fields, dispatch] = useReducer(authReducer, {
name: { error: null },
email: { error: null },
@jdltechworks
jdltechworks / Izanami.js
Last active May 20, 2020 03:38
Izanami - simple state management with react-navigation
import map from 'lodash/map'
import { useReducer } from 'react'
import { useNavigation, useRoute } from '@react-navigation/native'
const Izanami = (actions, reducer, initialState) => {
const [state, dispatch] = useReducer(reducer, initialState)
const navigation = useNavigation()
const route = useRoute()
const actionCreators = map(actions, value => value({ dispatch, state, route, navigation }))
return [state, ...actionCreators]
import map from 'lodash/map'
import groupBy from 'lodash/groupBy'
import reduce from 'lodash/reduce'
import omit from 'lodash/omit'
function hookie () {
document.addEventListener('livewire:load', (event) => {
window.livewire.hook('afterDomUpdate', (component) => {
nestedValidationErrors(component.errorBag, event, component.id)
})
<template>
<ion-content fullscreen class="ion-padding">
<ion-item class="ion-margin-bottom">
<ion-label position="floating">Username</ion-label>
<ion-input v-model="username"></ion-input>
</ion-item>
<ion-item class="ion-margin-bottom">
<ion-label position="floating">Password</ion-label>
<ion-input v-model="password" type="password"></ion-input>
</ion-item>
@jdltechworks
jdltechworks / LivewireComponentsFinder.php
Created May 9, 2022 22:38
Package based livewire using Routes instead of using Livewire::component
<?php
namespace MarketDragon\LivewireExtra;
use Exception;
use ReflectionClass;
use Illuminate\Filesystem\Filesystem;
use Symfony\Component\Finder\SplFileInfo;
use Livewire\Component;
@php
$logo = [
'text-lg',
'flex-1',
'text-gray-700',
'items-center',
'font-bold',
'no-underline',
'text-red',
'block',