Skip to content

Instantly share code, notes, and snippets.

View sagar290's full-sized avatar
🏠
Working from home

Sagar sagar290

🏠
Working from home
View GitHub Profile
@Shipu
Shipu / TypedArrayObject.php
Created August 3, 2022 14:41
Support TypedArrayObject in php
<?php
//Tinker away!
Class YourClassName
{
public string $name;
}
abstract class TypedArrayObject extends ArrayObject
{
@sentiasa
sentiasa / app.js
Last active February 5, 2024 23:12
Vite setup for Laravel, Inertia, Vue, Tailwind
import 'vite/dynamic-import-polyfill';
import '../css/app.css';
import { createApp, h } from 'vue'
import { App, plugin } from '@inertiajs/inertia-vue3'
let asyncViews = () => {
return import.meta.glob('./Pages/**/*.vue');
}
const app = createApp({
@berkorbay
berkorbay / github_desktop_ubuntu.md
Last active May 11, 2024 13:36
To install Github Desktop for Ubuntu

IMPORTANT

See the following links for further updates to Github Desktop for Ubuntu. These are official instructions. (also mentioned by fetwar on Nov 3, 2023)

For the sake of "maintaining the tradition" here is the updated version.

git_current_branch () {
local ref
ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null)
local ret=$?
if [[ $ret != 0 ]]
then
[[ $ret == 128 ]] && return
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
fi
echo ${ref#refs/heads/}
@vicgonvt
vicgonvt / deployment_guide.md
Last active March 17, 2024 06:51
Deployment Guide for Ubuntu Server from Scratch with Laravel
@iki
iki / Dockerfile
Last active April 20, 2020 09:20
Test volume mount in docker
FROM alpine
WORKDIR /data
COPY . .
CMD ls -l /data
@BenSampo
BenSampo / deploy.sh
Last active April 30, 2024 03:41
Laravel deploy script
# Change to the project directory
cd $FORGE_SITE_PATH
# Turn on maintenance mode
php artisan down || true
# Pull the latest changes from the git repository
# git reset --hard
# git clean -df
git pull origin $FORGE_SITE_BRANCH
@backslash112
backslash112 / alter-user.sql
Created May 16, 2018 14:26
Blog: Start a Remote MySQL Server with Docker quickly
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<password>';
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '<password>';
@Machy8
Machy8 / Dockerfile
Last active April 7, 2023 01:33
PHP-FPM 7.1 with Unix Sockets + Nginx in Docker
FROM debian:stretch
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
wget \
zip \
git \
unzip && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean
Install PHP 7.1
sudo update-alternatives --set php /usr/bin/php7.0
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.1
php -v
PHP 7.1 Modules list (Example)