Skip to content

Instantly share code, notes, and snippets.

View GaneshKandu's full-sized avatar
🎯
Focusing

Ganesh Kandu ( गणेश कांदु ) GaneshKandu

🎯
Focusing
View GitHub Profile
@GaneshKandu
GaneshKandu / nginx-https-local.md
Created March 14, 2024 04:58 — forked from mehmetsefabalik/nginx-https-local.md
Enable https on your local environment with nginx

enable https on your local environment

install mkcert and create certificates

brew install mkcert
mkcert -install
@GaneshKandu
GaneshKandu / Readme.md
Last active September 18, 2018 06:19
Sudoku Game validation

The classical Sudoku is a game, where the player needs to fill the gaps in a matrix of numbers (left image) in a way that three constraints are met: Every number between 1 and 9 can only be present exactly once in each of the

  • nine rows,
  • nine columns
  • nine 3x3 boxes. On the right side you see a solved Sudoku.
<?php
// Load source and mask
$source = imagecreatefrompng( '1.png' );
$mask = imagecreatefrompng( '2.png' );
// Apply mask to source
imagealphamask( $source, $mask );
// Output
header( "Content-type: image/png");
imagepng( $source );
@GaneshKandu
GaneshKandu / sunrise_sunset.php
Created February 27, 2018 12:01
This code will give you the sunrise and sunset times for any latutude and longitude in the world. You just need to supply the latitude, longitude and difference from GMT.
<html><body bgcolor=white><center><br><b>Sunrise Sunset</b><br><br>
<?
# This code will give you the sunrise and sunset times for any
# latutude and longitude in the world. You just need to supply
# the latitude, longitude and difference from GMT.
#
# for results in areas not using Daylight Savings Time, delete all
# references to the is_daylight_time() function
@GaneshKandu
GaneshKandu / gst.php
Created February 4, 2018 16:07
GST Calculator Class
include 'gst.php';
//adding gst
$return = gst::add(500,5);
print_r($return);
//removing gst
$return = gst::remove(500,5);
print_r($return);
@GaneshKandu
GaneshKandu / HexIP.php
Last active September 26, 2016 11:44
HEXT TO IP And IP TO HEX
<?php
/*
*
* @author Ganesh Kandu (mailto:kanduganesh@gmail.com)
*
*/
class HexIP{
@GaneshKandu
GaneshKandu / multi_array_diff.php
Created June 2, 2016 17:23
recursively difference of multidimensional arrays php
<?php
/*
*
* @author Ganesh Kandu (mailto:kanduganesh@gmail.com)
* @desc returns recursive difference of multiple dimensional arrays
*
* @param array1 "array 1 is a FIRST parameter of array type"
* @param array2 "array 2 is a second parameter of array type"
* @return array3 "returns a array type ,its a changed and extra values of array 1 which is not matches in array2"