Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Praneeth Nidarshan pranid

🎯
Focusing
Block or report user

Report or block pranid

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pranid
pranid / multi_array_sort.php
Created Mar 24, 2020
PHP - Multidimensional array sorting by specific key
View multi_array_sort.php
<?php
/**
* @param array $array
* @param string $_key
* @param string $_direction
* @version 1.0.0
* @author Praneeth Nidarshan (praneeth.nidarshan@gmail.com)
*/
function multiArraySort(&$array, $_key,$_direction = 'desc')
@pranid
pranid / compare_string_change.php
Created Jun 20, 2019
Compare character change count between string
View compare_string_change.php
<?php
$str_one = "PASS12345";
$str_two = "PASSWOD45";
$str_one_arr = str_split($str_one);
$new_arr = str_split($str_two);
$arr_intersect = array_intersect($new_arr, $str_one_arr);
$arr_changes = array_diff($new_arr, $arr_intersect);
@pranid
pranid / html-table2json-string.js
Last active Feb 14, 2018 — forked from ccheney/gist:4389114
jQuery: Convert HTML Table to JSON
View html-table2json-string.js
(function($){
var convertTableToJson = function()
{
var rows = [];
$('table tr').each(function(i, n){
// Ignore empty
if(i != 0) {
var $row = $(n);
rows.push({
display_name: $row.find('td:eq(0)').text(),
@pranid
pranid / TinyLog.php
Last active Apr 19, 2018
PHP Logger for analytics
View TinyLog.php
<?php
namespace TinyLog;
/**
* Tiny Log Generator
* @Author Praneeth Nidarshan
* @email praneeth.nidarshan@gmail.com
* @version 2.5.1
*
@pranid
pranid / ReadMe.txt
Created Dec 11, 2017 — forked from zeuxisoo/ReadMe.txt
Simple upload and resize image on PHP
View ReadMe.txt
- attachment
- 1.jpg
- 2.jpg
...
...
...
- index.php
- resize_image.php
- uploader.php
@pranid
pranid / timezone-grabber.php
Created Sep 19, 2017
Get PHP timezone list
View timezone-grabber.php
<?php
/**
* TIMEZONE GRABBER
* @author PRANEETH NIDARSHAN
*/
$zones = timezone_identifiers_list();
$new_list = array();
@pranid
pranid / Country API with Jquery | Bootstrap
Created Aug 17, 2017
Get countries from restcountries.eu and Display it using Bootstrap & Jquery
View Country API with Jquery | Bootstrap
<!DOCTYPE html>
<html>
<head>
<title>API TEST</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-1">
@pranid
pranid / form-submit-jquery.js
Last active Apr 17, 2018
PHP Ajax form controller Jquery
View form-submit-jquery.js
$(function () {
$.notifyDefaults({
placement: {from: "top", align: "center"},
animate: {enter: "animated fadeInUp", exit: "animated fadeOutDown"}
});
$('body').on('submit', 'form', function (e) {
e.preventDefault();
$('button[type=submit]').attr('disabled', true);
var data = new FormData($(this)[0]);
@pranid
pranid / select2.full.js
Created May 18, 2017
Bootstrap-Jquery Select2 :: Improved
View select2.full.js
/*!
* Select2 4.0.3
* https://select2.github.io
*
* Released under the MIT license
* https://github.com/select2/select2/blob/master/LICENSE.md
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
@pranid
pranid / bulk_renamer.php
Last active Mar 29, 2017
Rename bulk files or folders :: PHP
View bulk_renamer.php
<?php
/**
* BULK FILE AND FOLDER RENAMER
* @author PRANEETH NIDARSHAN
* @version 1.3
* @email praneeth.nidarshan@gmail.com
*/
$results = array();
You can’t perform that action at this time.