Skip to content

Instantly share code, notes, and snippets.

View rizkhal's full-sized avatar
🌴
On vacation

Rizkhal rizkhal

🌴
On vacation
View GitHub Profile
@rizkhal
rizkhal / README
Created November 17, 2023 11:33 — forked from jmatsushita/README
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
###
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places.
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of
###. things to watch out for:
### - Check out the `nix-darwin` instructions, as they have changed.
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026
###
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
@rizkhal
rizkhal / Bootstrap.php
Created February 12, 2023 23:48 — forked from kassah/Bootstrap.php
Multi-database testing utilizing Laravel Multitenancy & MySQL while utilizing existing Laravel RefreshDatabase trait.
<?php
// in tests/Bootstrap.php
// Only run this in the case of non-parallel testing. Parallel testing is handled through events registered on.
// App/Providers/TestDatabaseProvider
if (getenv('LARAVEL_PARALLEL_TESTING') === false) {
require('vendor/autoload.php');
/** @var \Illuminate\Foundation\Application $app */
$app = require __DIR__ . '/../bootstrap/app.php';
$app->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap();
@rizkhal
rizkhal / App.tsx
Created November 29, 2022 04:07 — forked from robertohein/App.tsx
React Native WebView persist state from localStorage on AsyncStorage and load state from AsyncStorage (useful with redux-persist)
import React, { useEffect, useRef, useState } from 'react';
import { StyleSheet } from 'react-native';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { SafeAreaView } from 'react-native-safe-area-context';
import WebView, { WebViewMessageEvent } from 'react-native-webview';
import { StatusBar } from 'expo-status-bar';
enum MessageTypes {
@rizkhal
rizkhal / GoogleDriveServiceProvider.php
Created June 26, 2022 13:59 — forked from sergomet/GoogleDriveServiceProvider.php
Setup a Laravel Storage driver with Google Drive API
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class GoogleDriveServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@rizkhal
rizkhal / ConsoleSchedulingTest.php
Created March 14, 2022 13:37 — forked from MattApril/ConsoleSchedulingTest.php
A simple way of testing that your Laravel commands are scheduled exactly when and how you expect. This approach does not trigger commands to actually execute, which is what a lot of other suggestions do.
<?php
use App\Console\Kernel;
use Carbon\Carbon;
use Illuminate\Console\Scheduling\Event;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Support\Collection;
class ConsoleSchedulingTest extends TestCase
{
@rizkhal
rizkhal / config.conf
Created February 12, 2022 09:31
Nuxt or Vue Nginx Configuration Reverse Proxy
server {
listen 80;
listen 443 ssl;
server_name domainname.com;
gzip on;
gzip_types text/plain application/xml;
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 1000;
@rizkhal
rizkhal / centos7-nginx-laravel-configuration
Created November 3, 2021 02:05 — forked from breekoy/centos7-nginx-laravel-configuration
Configuration steps on CentOS7 server to run Laravel applications + Redis and Node.JS on nginx
==== CENTOS 7 LEMP STACK INSTALLATION ====
0. Make sure the centos 7 server have internet connection
1. Install the EPEL Repository
sudo yum -y install epel-release
2. Install the Remi Repository
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
3. Install Nginx
<x-layout>
<x-section>
<x-tabs active="First">
<x-tab name="First">
First content goes here.
</x-tab>
<x-tab name="Second">
Second content goes here.
</x-tab>
@rizkhal
rizkhal / laravel-livewire-tables-demo-table.php
Created August 17, 2021 02:54 — forked from rappasoft/laravel-livewire-tables-demo-table.php
Laravel Livewire Tables Demo Table Source
<?php
namespace App\Http\Livewire;
use App\Models\User;
use Illuminate\Database\Eloquent\Builder;
use Rappasoft\LaravelLivewireTables\DataTableComponent;
use Rappasoft\LaravelLivewireTables\Views\Column;
use Rappasoft\LaravelLivewireTables\Views\Filter;