Skip to content

Instantly share code, notes, and snippets.

View bigprof's full-sized avatar

BigProf Software bigprof

View GitHub Profile
@bigprof
bigprof / README.md
Last active July 13, 2022 13:45
Bash script to switch PHP version on Debian/Ubuntu

Bash script to switch PHP version on Debian/Ubuntu

You can run multiple versions of PHP on the same server. This is useful in many cases. For example:

  • Testing the same PHP app under multiple PHP versions.
  • Running several PHP apps that each requires a different version of PHP

I personally find this very useful to rapidly test apps generated by AppGini under multiple PHP versions.

AppGini is a nocode/lowcode graphical tool for configuring and generating web applications for easily managing data for small businesses, organizations, teams in small/large companies, or even your indvidual projects. Apps created by AppGini support multiple users, are responsive and mobile-friendly, work on LAMP stack for easy installation and wide support, allow importing and exporting of data to CSV, and many more features. A free fully working trial of AppGini can be downloaded from here

@bigprof
bigprof / README.md
Last active July 29, 2022 13:15
Show theme switcher widget at the bottom of your AppGini app, similar to the demo at https://demos.appgini.com/northwind/

Steps to add a theme switcher to your AppGini app

  1. Place the code below in the generated hooks/footer-extras.php file.
  2. Open the folder where AppGini is installed, typically C:\program files\appgini and navigate to the add-ons\themes folder.
  3. Copy all the CSS files in that folder to the resources\initializr\css folder inside your AppGini app.

If you follow the above steps, you should be able to switch your app themes like this:

@bigprof
bigprof / footer-extras.php
Last active April 22, 2022 15:22
Add a counter column to the print preview of the table view in your AppGini app
@bigprof
bigprof / git-deployment.md
Created April 3, 2019 17:59 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@bigprof
bigprof / google-search.robot
Created February 20, 2019 12:43
Sample Robot Framework script for checking if a certain site appears in the first results page when searching Google for specific keywords.
*** Settings ***
Library Selenium2Library
Suite Setup start browser
Suite Teardown end browser
*** Variables ***
${browser} = ff
@bigprof
bigprof / bootstrap.php
Created February 17, 2019 17:34
Sample PHPUnit bootstrap file for an AppGini project
<?php
// my app includes
include('./app/defaultLang.php');
include('./app/lib.php');
@bigprof
bigprof / phpunit.xml
Created February 17, 2019 17:30
Sample PPHUnit config
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
@bigprof
bigprof / mysql-php-queries.php
Last active May 2, 2018 10:59
Script to display INSERT/UPDATE/SELECT queries for a specific table in a specific database (you'll be asked for these first). The queries are suitable for use in PHP programs. Don't forget to sanitize any variables before using them in your queries! Here is a short screencast showing it in action: https://www.screencast.com/t/tvyp9P1F
<?php
/* Change the values below to match your database */
$config = [
'server' => 'localhost',
'user' => 'dbuser',
'pass' => 'password'
];
if(!isset($_REQUEST['db']) || !isset($_REQUEST['table'])) {
?>
@bigprof
bigprof / global-search.php
Last active October 1, 2022 12:34
Basic script to perform global search on all tables of an AppGini application.
<?php
/**
* Basic script to perform global search on all tables of an AppGini application.
* Create a new file inside the hooks folder and name it 'global-search.php' then copy this code to it.
* Related post: https://forums.appgini.com/phpbb/viewtopic.php?f=2&t=1689&p=4510
*/
/* Assuming this custom file is placed inside 'hooks' */
define('PREPEND_PATH', '../');
$hooks_dir = dirname(__FILE__);
@bigprof
bigprof / custom.php
Created November 27, 2017 12:43
AppGini custom page inside hooks folder
<?php
/* Assuming this custom file is placed inside 'hooks' */
define('PREPEND_PATH', '../');
$hooks_dir = dirname(__FILE__);
include("{$hooks_dir}/../defaultLang.php");
include("{$hooks_dir}/../language.php");
include("{$hooks_dir}/../lib.php");
include_once("{$hooks_dir}/../header.php");