Skip to content

Instantly share code, notes, and snippets.

@imanifaiz
imanifaiz / massInsertOrUpdate.php
Created April 12, 2024 16:54 — forked from RuGa/massInsertOrUpdate.php
Mass (bulk) insert or update on duplicate for Laravel 4/5
/**
* Mass (bulk) insert or update on duplicate for Laravel 4/5
*
* insertOrUpdate([
* ['id'=>1,'value'=>10],
* ['id'=>2,'value'=>60]
* ]);
*
*
* @param array $rows
@imanifaiz
imanifaiz / cashier.php
Created January 17, 2024 03:01 — forked from Braunson/cashier.php
Extending the Laravel package Cashier for creating an customer without a credit card
namespace Acme\V1\Billing;
// BillableInterface.php
use Laravel\Cashier\BillableInterface as CashierInterface;
interface BillableInterface extends CashierInterface {
}
@imanifaiz
imanifaiz / nginx.conf
Created February 10, 2023 12:06 — forked from v0lkan/nginx.conf
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
@imanifaiz
imanifaiz / form-validation-with-alpine-js-and-iodine.markdown
Created December 4, 2022 14:03
Form validation with Alpine.JS and Iodine
@imanifaiz
imanifaiz / index.html
Created November 27, 2022 03:21
Select Field with Search - AlpineJs + Tailwind
<div class="flex flex-col items-center">
<div class="w-full md:w-1/2 flex flex-col items-center h-64">
<div class="w-full px-4">
<div x-data="selectConfigs()" x-init="fetchOptions()" class="flex flex-col items-center relative">
<div class="w-full">
<div @click.away="close()" class="my-2 p-1 bg-white flex border border-gray-200 rounded">
<input
x-model="filter"
x-transition:leave="transition ease-in duration-100"
x-transition:leave-start="opacity-100"
@imanifaiz
imanifaiz / mysql-sail.md
Created January 21, 2022 12:44 — forked from jjcodes78/mysql-sail.md
Laravel Sail - GRANT ALL PRIVILEGES to sail user

Run this command in sail project folder:

docker-compose exec mysql bash

execute the mysql -u root -p command

provide the default password password

then executes

@imanifaiz
imanifaiz / mysql-db-dump-backup.sh
Created April 18, 2021 00:12 — forked from yashodhank/mysql-db-dump-backup.sh
Shell Script to take mysql database dump backup and upload to FTP or send it as email
#!/bin/sh
# This script will backup one or more mySQL databases
# and then optionally email them and/or FTP them
# This script will create a different backup file for each database by day of the week
# i.e. 1-dbname1.sql.gz for database=dbname1 on Monday (day=1)
# This is a trick so that you never have more than 7 days worth of backups on your FTP server.
# as the weeks rotate, the files from the same day of the prev week are overwritten.
@imanifaiz
imanifaiz / Bash MySQL backupo script
Created March 16, 2021 00:45 — forked from walterheck/Bash MySQL backupo script
Backup script for MySQL backups locally, both mysqldumps and binary backupos using percona's xtrabackup
#!/bin/bash
# Configuration
. /etc/mysql/mysql_backup.conf
# Dump the mysql databases to a daily dump file.
function log()
{
logger -i -p daemon.info -t mysqldump "$1"
echo $1 >> $LOGFILE
@imanifaiz
imanifaiz / oracle-instant-client.sh
Created February 22, 2021 03:30 — forked from cbj4074/oracle-instant-client.sh
Shell script to install Oracle OCI8 extension for PHP on Ubuntu
#!/bin/sh
echo 'Installing Oracle Instant Client...'
export DEBIAN_FRONTEND=noninteractive
apt-get -yq install libaio1 unzip php-dev
# See: http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html#ic_x64_inst
client_version='12_2'
@imanifaiz
imanifaiz / main.dart
Created July 18, 2020 12:14
dart oop
void main() {
var deck = new Deck();
// deck.shuffle();
// print(deck.cardsWithSuit('Diamond'));
// deck.deal(50);
deck.removeCard('Heart', 'Ace');
deck.removeCard('Heart', 'One');
print(deck.cards);
}