Skip to content

Instantly share code, notes, and snippets.

View zgabievi's full-sized avatar
💤
Zzzing

Zura Gabievi zgabievi

💤
Zzzing
View GitHub Profile
@zgabievi
zgabievi / parallels.md
Created August 16, 2021 15:55
Fix parallels desktop problems

Network

  1. sudo nano /Library/Preferences/Parallels/network.desktop.xml
  2. find <UseKextless>1</UseKextless> (value can be -1), and change the value to the <UseKextless>0</UseKextless>
  3. if you can't to find this tag, then just create it under root tag here

USB

  1. sudo nano /Library/Preferences/Parallels/dispatcher.desktop.xml
  2. find 0 and change to 1
@zgabievi
zgabievi / Dropdown.vue
Created January 31, 2021 19:30
Vue + TailwindCSS (Transitions)
<template>
<transition
enter-active-class="ease-out duration-300"
enter-class="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
enter-to-class="opacity-100 translate-y-0 sm:scale-100"
leave-active-class="ease-in duration-200"
leave-class="opacity-100 translate-y-0 sm:scale-100"
leave-to-class="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
>
<div v-if="show">DROPDOWN</div>
<?php
namespace App\Providers;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider
{
//
@zgabievi
zgabievi / what-i-use.md
Last active March 31, 2020 18:23
What I use

What I Use

Hardware

  • MacBook Pro (Retina, 16-inch, 2019)
    • 2.3 GHz 8-Core Intel Core i9
    • 16 GB 2667 MHz DDR4
    • Intel UHD Graphics 630 1536 MB
  • Apple Magic Mouse 2
  • Apple Magic Keyboard 2
@setup
if (!isset($env)) {
throw new Exception('--env must be specified');
}
$prod = false;
$server = '101.101.101.101';
$branch = 'develop';
$base_dir = '/var/www/html';
@zgabievi
zgabievi / usePortal.tsx
Created April 23, 2019 13:36
React Portals with Hooks
import React, { useRef, useEffect } from 'react';
//
const createRootElement = (id: string): Element => {
const rootContainer = document.createElement('div');
rootContainer.setAttribute('id', id);
return rootContainer;
};
//
@zgabievi
zgabievi / index.js
Last active April 28, 2018 18:18
Web APIs
// PAGE VISIBILITY
window.addEventListener('visibilitychange', () => {
if (document.hidden) {
console.log('TAB is hidden');
} else {
console.log('TAB is visible');
}
});
window.addEventListener('visibilitychange', () => {
let mix = require('laravel-mix');
mix.copyDirectory('node_modules/bpg-nino-elite-exp/fonts', 'public/fonts')
.copyDirectory('node_modules/bpg-nino-medium-caps/fonts', 'public/fonts')
.js('resources/assets/js/main.js', 'public/js')
.sass('resources/assets/sass/style.scss', 'public/css')
.styles([
'node_modules/font-awesome/css/font-awesome.css',
'node_modules/bootstrap/dist/css/bootstrap.css',
'node_modules/bpg-nino-elite-exp/css/bpg-nino-elite-exp.css',
@zgabievi
zgabievi / console.php
Last active January 14, 2018 18:33
Artisan command make:scaffold to create all model related files in Laravel.
<?php
Artisan::command('make:scaffold {name?}', function ($name = null) {
$name = $name ?? $this->ask('What is the name of the model?');
$this->call('make:model', [
'name' => $name,
'--all' => true,
]);
@zgabievi
zgabievi / DatabaseSeeder.php
Created August 13, 2017 12:52
FOREIGN_KEY problem in DatabaseSeeder solved!
<?php
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void