Skip to content

Instantly share code, notes, and snippets.

@ux-powered
ux-powered / index.html
Created June 23, 2020 06:35
Dictionary editor
<div id="dict-container"></div>
<button id="dict-add" class="btn btn-primary">Add</button>
<button id="dict-clear" class="btn btn-danger">Clear all</button>
@ux-powered
ux-powered / README.md
Created June 23, 2020 06:02
laravel/ui scaffolding for laravel-starter project

Prepare for scaffolding:

  1. Duplicate your package.json.
  2. Create empty resources/js/bootstrap.js, resources/sass/app.scss and resources/sass/_variables.scss files.

Installing and scaffolding:

composer require laravel/ui

@ux-powered
ux-powered / README.md
Created June 9, 2020 03:35
PhotoSwipe + Swiper integration

The code snippet of PhotoSwipe + Swiper integration. Works for both looped and non-looped sliders.

  1. Create libs/photoswipe/photoswipe-swiper.js
  2. Import the created file in the libs/photoswipe/photoswipe.js and export initPhotoSwipeWithSwiper function
  3. Init PhotoSwipe on the .swiper-wrapper element

Note: You can include libs/photoswipe/photoswipe.js and use both initPhotoSwipeFromDOM() and initPhotoSwipeWithSwiper() functions; or include only libs/photoswipe/photoswipe-swiper.js if you don't need default PhotoSwipe initializer.

@ux-powered
ux-powered / README.md
Created May 25, 2020 09:33
Deploy a Laravel project to a subdirectory

The guide how to deploy a Laravel project to a subdirectory.

Let's assume we want to deploy our laravel-demo app to http://example.com/laravel_demo/. Here's what you will need to do:

  1. Add the next key to your .env config:
ASSET_URL=
@ux-powered
ux-powered / .babelrc
Last active May 20, 2020 12:54
React + Laravel integration guide
{
"presets": [
"@babel/react",
[
"@babel/env",
{
"targets": {
"browsers": [
">= 1%",
"last 2 versions",
@ux-powered
ux-powered / README.md
Last active April 10, 2020 06:09
React App polyfills

Do not forget to install required packages:

yarn add react-app-polyfill url-polyfill custom-event-polyfill


CRA dev server doesnt support IE10, so if you need to test the app in IE10, prepend the next line to the <head> block in public/index.html:

``

@ux-powered
ux-powered / How-to.md
Last active December 16, 2022 01:46
Deploy a Laravel-Vue project to a subdirectory

The guide how to deploy a Laravel-Vue project to a subdirectory.

Let's assume we want to deploy our app to http://example.com/projects/laravel-vue-demo/. Here's what you will need to do:

  1. Add the next keys to your .env config:
APP_PUBLIC_PATH=
VUE_PUBLIC_PATH=/
@ux-powered
ux-powered / .eslintignore
Last active November 16, 2020 22:08
Appwork + NUXT Guide
bower_components/
build/Release/
node_modules/
jspm_packages/
typings/
.next/
.nuxt/
dist/
/vendor/libs/**/*.js
@ux-powered
ux-powered / app.module.ts
Created November 26, 2019 06:41
Dropzone within a modal component example
import { BrowserModule, Title } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { DropzoneModule } from 'ngx-dropzone-wrapper';
import { DropzoneModalComponent } from './page/dropzone-modal.component'
// *******************************************************************************
// NgBootstrap
@ux-powered
ux-powered / dynamic-sidenav-width.js
Last active February 26, 2019 05:13
Dynamic sidenav width
function setSidenavWidth (widthInPixels) {
let styleEl = document.getElementById('sidenav-width-stylesheets')
const sidenavWidth = Math.round(widthInPixels / 16 * 1000) / 1000
const sidenavCollapsedWidth = 4.375 // rem
if (!styleEl) {
styleEl = document.createElement('style')
styleEl.type = 'text/css'
styleEl.id = 'sidenav-width-stylesheets'
document.querySelector('head').appendChild(styleEl)