Skip to content

Instantly share code, notes, and snippets.

View tahafarooqui's full-sized avatar

Taha Farooqui tahafarooqui

View GitHub Profile
@tahafarooqui
tahafarooqui / LinkedIn Unfollow Following Connections Script
Created April 8, 2023 07:57
LinkedIn Unfollow Following Connections Script
(() => {
let count = 0;
function getAllButtons() {
return document.querySelectorAll('button[data-control-name="entity_action_primary"]') || [];
}
async function unfollowAll() {
const buttons = getAllButtons();
@tahafarooqui
tahafarooqui / Modulo (%) Function in PHP.php
Last active October 11, 2020 16:49
Modulo (%) Function in PHP
<?php
$price = 1000;
$mod = 8.5;
//1000 * 2% = 80
//OR
//1000 % 8 = 80
echo get_modulo($price,$mod); //Ans 80
@tahafarooqui
tahafarooqui / Unix Date
Last active January 12, 2018 19:36
PHP Unix Date Insert, Update
// Static
$checkIN = $this->input->post('checkIN');
$checkIN = str_replace("/", "-", $checkIN);
$checkIN = date('Y-m-d h:i:s', strtotime($checkIN));
$checkOUT = $this->input->post('checkOUT');
$checkOUT = str_replace("/", "-", $checkOUT);
$checkOUT = date('Y-m-d h:i:s', strtotime($checkOUT));
@tahafarooqui
tahafarooqui / Jquery datepicker restrict dates in second date field based on selected date in first date field
Last active September 17, 2017 01:26
Jquery datepicker restrict dates in second date field based on selected date in first date field
jQuery(".startDate").datepicker({
minDate: 0,
onSelect: function (selected) {
var dt = jQuery(this).datepicker("getDate");
dt.setDate(dt.getDate() + 1);
jQuery(".endDate").datepicker("option", "minDate", dt);
jQuery(".endDate").datepicker("option", "dateFormat", "dd.mm.yy");
jQuery(".endDate").datepicker("setDate", dt);
//Dateformat
@tahafarooqui
tahafarooqui / How to change month name DatePicker (calendar)
Created September 17, 2017 01:15
How to change month name DatePicker (calendar)
jQuery(".endDate").datepicker({
minDate: 0,
monthNames: ["Januar","Februar","Marz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]
});
@tahafarooqui
tahafarooqui / Displaying jQuery's Datepicker in the center of the screen
Last active March 15, 2022 11:11
Displaying jQuery's Datepicker in the center of the screen
@media(max-width:992px){
/* On mobile set datepicker to viewport center*/
#ui-datepicker-div {
position: fixed !important;
left: 50% !important;
top: 50% !important;
transform:translate(-50%, -50%);
-webkit-transform:translate(-50%, -50%);
}
}
__cnt__ = 0;
jQuery('.follow-text').each(function(i, ele) {
ele = jQuery(ele);
if (ele.css('display') != 'block') {
//alert('already following:', i);
return;
}
setTimeout(function() {
ele.click();
}, __cnt__++ * 500);
@tahafarooqui
tahafarooqui / Delete all facebook group members at once.txt
Created March 27, 2017 15:27
Delete all facebook group members at once - Updated 2017
var deleteAllGroupMembers = (function () {
var deleteAllGroupMembers = {};
// the facebook ids of the users that will not be removed.
// IMPORTANT: add your own facebook id here so that the script will not remove yourself!
var excludedFbIds = ['1234','11223344']; // make sure each id is a string!
var usersToDeleteQueue = [];
var scriptEnabled = false;
var processing = false;
deleteAllGroupMembers.start = function() {