Skip to content

Instantly share code, notes, and snippets.

View inmanturbo's full-sized avatar

Kevin Inman inmanturbo

  • 'Murica
  • 19:02 (UTC -04:00)
View GitHub Profile
@inmanturbo
inmanturbo / laravel_new.sh
Last active May 1, 2025 22:19
Laravel new using private starter kit
laravel new private-project \
--git \
--using="username/starter-kit-name --repository='{\"url\": \"https://github.com/username/starter-kit-name.git\", \"type\": \"vcs\"}' --remove-vcs"
@inmanturbo
inmanturbo / tailwind.js
Created January 25, 2025 16:24 — forked from heytulsiprasad/tailwind.js
Config tailwind to desktop first approach
module.exports = {
theme: {
extend: {},
screens: {
xl: { max: "1279px" },
// => @media (max-width: 1279px) { ... }
lg: { max: "1023px" },
// => @media (max-width: 1023px) { ... }
@inmanturbo
inmanturbo / mod.sh
Created September 25, 2024 15:21
Script for using small laravel apps as locally developed packages, or "modules"
#!/usr/bin/env bash
mod=$1
package_vendor=$2
package_namespace=$3
fqns="${package_vendor}\\${package_namespace}"
path="mod/$mod"
if [ ! -d "$path" ]; then
(cd mod && laravel new "$mod")
@inmanturbo
inmanturbo / AppName.php
Created August 26, 2024 02:04 — forked from isluewell/AppName.php
[6.0] Command app:name
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Composer;
use Symfony\Component\Finder\Finder;
use Illuminate\Filesystem\Filesystem;
use Symfony\Component\Console\Input\InputArgument;
@inmanturbo
inmanturbo / manifest.json
Last active March 29, 2024 19:32
Progressive Web App
{
"name": "My App Name",
"short_name": "MAN",
"start_url": "https://example.com",
"background_color": "#6777ef",
"description": "Tutorial of Laravel Package",
"display": "fullscreen",
"theme_color": "#6777ef",
"icons": [
{
@inmanturbo
inmanturbo / gist:2f9d3adb29ae5091379f92caf350dd5d
Created February 8, 2024 07:18
foreach (File::glob(base_path('.www').'/[0-9]*', GLOB_ONLYDIR) as $version) {
// foreach (File::glob(base_path('.www').'/[0-9]*', GLOB_ONLYDIR) as $version) {
// $version = basename($version);
// Folio::path(base_path('.www/'.$version))
// ->uri('/v'.$version)
// ->middleware([
// 'web',
// 'auth:sanctum',
// config('jetstream.auth_session'),
// 'verified',
// ]);
@inmanturbo
inmanturbo / centered_popup.md
Last active August 19, 2023 08:21
Center a popup

Here is the function

The struggle is determining the center of the current screen in a multi-monitor setup, so I finally solved this by centering the pop-up over the parent window. You have to pass the parent window as another parameter:

<script>
function popupWindow(url='', windowName='', win, w='650', h='650') {
    const y = win.top.outerHeight / 2 + win.top.screenY - ( h / 2);
    const x = win.top.outerWidth / 2 + win.top.screenX - ( w / 2);
    return win.open(
        url, 
@inmanturbo
inmanturbo / resizeable-tables.js
Created August 8, 2023 01:30
Make table borders resizable
let tables = document.getElementsByTagName("table");
for (var i = 0; i < tables.length; i++) {
resizableGrid(tables[i]);
}
function resizableGrid(table) {
var row = table.getElementsByTagName("tr")[0],
cols = row ? row.children : undefined;
if (!cols) return;
table.style.overflow = "hidden";
@inmanturbo
inmanturbo / copy_database.sql
Created August 6, 2023 05:14
Procedure to copy a mariadb database
DELIMITER //
CREATE PROCEDURE CopyDatabase(sourceDbName CHAR(255))
BEGIN
DECLARE done INT DEFAULT 0;
DECLARE tableName CHAR(255);
DECLARE targetDbName CHAR(255);
DECLARE cur CURSOR FOR
SELECT table_name FROM information_schema.tables
WHERE table_schema = sourceDbName;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
@inmanturbo
inmanturbo / darkmode-layout-head-script.html
Created April 26, 2023 15:43
jetstream darkmode with toggle
<script>
// On page load or when changing themes, best to add inline in `head` to avoid FOUC
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
document.documentElement.classList.add('dark')
} else {
document.documentElement.classList.remove('dark')
}
</script>