Skip to content

Instantly share code, notes, and snippets.

View kuya-joe's full-sized avatar

Joe kuya-joe

View GitHub Profile
@kuya-joe
kuya-joe / index.php
Created August 27, 2023 03:12 — forked from vinzenz/index.php
Extremely Simple Sample TODO List App in PHP
<!--
Copyright 2017 Vinzenz Feenstra, Red Hat, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@kuya-joe
kuya-joe / deploy.sh
Last active July 22, 2023 23:57 — forked from BenSampo/deploy.sh
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
@kuya-joe
kuya-joe / AppServiceProvider.php
Created June 6, 2023 09:00 — forked from simonhamp/AppServiceProvider.php
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@kuya-joe
kuya-joe / ArrayPaginator.php
Created June 6, 2023 07:48 — forked from kkiernan/ArrayPaginator.php
A reusable helper class for pagination of array items in Laravel.
<?php
namespace App\Http\Utilities;
use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;
class ArrayPaginator
{
@kuya-joe
kuya-joe / import.md
Last active May 22, 2023 00:06 — forked from iamstoick/import.md
How to import database in MySQL in Docker?

This is a simple way of importing MySQL database in Docker.

  1. In you Dockerfile you must have a shared folder. Shared folder is a directory in your host machine that is mounted to Docker instance.

  2. Put the exported sql file in the shared folder.

  3. Login to your Docker instance via docker exec -it DOCKER_CONTAINER_ID bin/bash.

  4. Login to MySQL via mysql -u USERNAME -p. Use -P/--port to specify the port if your exposed port of your docker mysql service is different.

@kuya-joe
kuya-joe / .tmux.conf
Created April 11, 2023 07:02 — forked from tsl0922/.tmux.conf
vim style tmux config
# vim style tmux config
# use C-a, since it's on the home row and easier to hit than C-b
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
set -g base-index 1
# Easy config reload
bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
@kuya-joe
kuya-joe / .zshrc
Created March 21, 2023 23:31 — forked from bashbunni/.zshrc
CLI Pomodoro for Mac
# I'll be doing another one for Linux, but this one will give you
# a pop up notification and sound alert (using the built-in sounds for macOS)
# Requires https://github.com/caarlos0/timer to be installed
# Mac setup for pomo
alias work="timer 60m && terminal-notifier -message 'Pomodoro'\
-title 'Work Timer is up! Take a Break 😊'\
-appIcon '~/Pictures/pumpkin.png'\
-sound Crystal"
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
@kuya-joe
kuya-joe / install_LEMP.sh
Last active September 4, 2022 03:50 — forked from armohamm/install_LEMP.sh
Auto basic LEMP installation script for Ubuntu 20.04+(nginx, MySql (not maria!), PHP8.0)
#!/bin/bash
######################################################
# AUTO LEMP INSTALLATION #
# Written by Gil Shwartz #
# gilshwartzdjgs@gmail.com #
######################################################
clear
echo "#######################################################"
if (( $EUID != 0 )); then
echo
@kuya-joe
kuya-joe / composer.json
Created July 5, 2021 03:28 — forked from jibone/composer.json
My generic composer file for a PHP project.
{
"require": {
"php": ">=5.3.1",
"behat/behat": "2.4.*@stable",
"behat/mink": "1.4@stable",
"behat/mink-extension": "*",
"behat/mink-goutte-driver": "*",
"behat/mink-sahi-driver": "*",
"behat/mink-selenium-driver": "*",
"behat/mink-selenium2-driver": "*",