Skip to content

Instantly share code, notes, and snippets.

@kongondo
kongondo / private_fork.md
Created March 3, 2025 22:56 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@kongondo
kongondo / cors.php
Created January 21, 2025 04:45 — forked from avtaniket/cors.php
Handle CORS in PHP
<?php
/* Handle CORS */
// Specify domains from which requests are allowed
header('Access-Control-Allow-Origin: *');
// Specify which request methods are allowed
header('Access-Control-Allow-Methods: PUT, GET, POST, DELETE, OPTIONS');
@kongondo
kongondo / .htaccess
Created December 17, 2024 06:58 — forked from mandrasch/.htaccess
.htaccess - fix http to https redirect for DDEV
# Debug trick, uncomment to check values:
# ErrorDocument 404 "Request: %{THE_REQUEST} Referrer: %{HTTP_REFERER}, Host: %{HTTP_HOST}, HTTPS: %{HTTPS}, HTTP:X-Forwarded-Proto: %{HTTP:X-Forwarded-Proto}"
# RewriteRule ^ - [L,R=404]
# The general rule for redirecting HTTP to HTTPS:
# --> Results in "Error too many redirects" in DDEV, because %{HTTPS} is always == off
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
@kongondo
kongondo / github-ssh-deploy.yml
Created October 23, 2024 20:30 — forked from rodgtr1/github-ssh-deploy.yml
Use GitHub actions to set up automated deployment of WordPress site via SSH on any hosting provider
name: Hostinger SSH Deployment
on:
push:
branches: [main]
workflow_call:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
@kongondo
kongondo / findphpini.md
Created May 5, 2024 15:36 — forked from pvm-77/findphpini.md
how to find php.ini file in ubuntu

In Ubuntu, the location of the php.ini file can vary depending on the installation and version of PHP you are using, as well as the web server you are using. Here are a few common locations where you can find the php.ini file:

  1. /etc/php/7.4/apache2/php.ini This is the default location for the php.ini file for PHP version 7.4 on Apache web server.

  2. /etc/php/7.4/cli/php.ini This is the php.ini file used by the PHP command-line interface (CLI).

  3. /usr/local/etc/php/php.ini This is the location for the php.ini file on some installations of PHP.

@kongondo
kongondo / windows_font_installer.py
Created March 3, 2024 22:34 — forked from lpsandaruwan/windows_font_installer.py
Install a font file in Windows - Python3
""" Python 3 Windows font installer
Script must be run with the privileges in order to access Windows fonts directory. System reboot is not necessary.
This will install the font and will inform programs that a new font has been added.
Python3 Windows font installer is a free python script: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@kongondo
kongondo / index.php
Created February 15, 2024 10:26 — forked from vielhuber/index.php
get next letter in alphabet #php
<?php
$letter = 'A';
echo ++$letter; // outputs 'B'
echo chr(ord($letter) + 3); // outputs 'E'
?>
@kongondo
kongondo / preventAdditionalMouseEvent.html
Created April 15, 2023 12:02 — forked from toruta39/preventAdditionalMouseEvent.html
Prevent mouseout/mouseover event triggered when moving onto/from a child element
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Prevent additional mouse event</title>
</head>
<body>
<div id="ele" style="width: 300px; height: 300px; background-color: #0FF;">
This is the parent element.
<div style="width: 200px; height: 200px; background-color: #FFF;">
@kongondo
kongondo / salesTax.md
Created September 27, 2021 05:08 — forked from lakshmantgld/salesTax.md
Free Sales Tax API based on Postal code by Avalara

Sales Tax API

There are many companies providing sales tax API. Out of all the companies, Avalara offers free API service for sales Tax. This gist is all about setting up avalara API and querying it.

The Free-To-Use API by avalara has some restrictions. Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP response code 429 - Too Many Requests. The requirement for this API is to create an avalara free trail account. You can create a free account using this link create free account.

Once you have filled the form from above link, you will get an e-mail containing temporary credentials to login the avalara account. The e-mail will look something like this:

Avalara e-mail

@kongondo
kongondo / salesTax.md
Created September 27, 2021 05:08 — forked from lakshmantgld/salesTax.md
Free Sales Tax API based on Postal code by Avalara

Sales Tax API

There are many companies providing sales tax API. Out of all the companies, Avalara offers free API service for sales Tax. This gist is all about setting up avalara API and querying it.

The Free-To-Use API by avalara has some restrictions. Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP response code 429 - Too Many Requests. The requirement for this API is to create an avalara free trail account. You can create a free account using this link create free account.

Once you have filled the form from above link, you will get an e-mail containing temporary credentials to login the avalara account. The e-mail will look something like this:

Avalara e-mail