Skip to content

Instantly share code, notes, and snippets.

@M-ZubairAhmed
M-ZubairAhmed / uncheck-viewed.js
Created November 8, 2023 12:47
Uncheck all viewed files in Github
const allViewedCheckbox = document.getElementsByClassName('mr-1 js-reviewed-checkbox')
for(viewedCheckbox of allViewedCheckbox) {
if (viewedCheckbox.checked) {
viewedCheckbox.click()
}
}
@M-ZubairAhmed
M-ZubairAhmed / create-channels.sh
Last active November 8, 2023 12:44
Create multiple Mattermost channels without being in each of them
# Run this bash file inside of mmctl directory or replace ./mmctl with the path to mmctl
for i in {1..100}
do
# First command creates a channel with user included in the channel
./mmctl channel create --team XXXTeamNameXXX --display-name "${i}-channel" --name "${i}-channel"
# Second command removes all the users from the created channel
./mmctl channel users remove "XXXTeamNameXXX:${i}-channel" --all-users
done
@M-ZubairAhmed
M-ZubairAhmed / generate-custom-emojis.sh
Last active June 11, 2023 10:45
Script to generate 5k custom emojis in Mattermost
#!/bin/bash
#title :generate-custom-emojis.sh
#description :This script create 4000 custom emojis in mattermost.
#authors :saturninoabril,m-zubairahmed
#version :0.2
#notes :Replace token and creator id with your own.
# e.g. TOKEN="xgqkaquaii8cz8pqqak5jsfm8c"
TOKEN="XX"
@M-ZubairAhmed
M-ZubairAhmed / continous-message-mmctl.sh
Last active June 11, 2023 10:41
Spam a Mattermost channels with continuous posts
#!/bin/bash
SLEEP_TIME=1
NUM_OF_MESSAGES=100
PACK=$RANDOM
echo "Sending continous messages with wait time of ${SLEEP_TIME} seconds between each message"
for (( i=1; i<=$NUM_OF_MESSAGES; i++ ))
do
@M-ZubairAhmed
M-ZubairAhmed / console_save.js
Created May 23, 2023 12:34
Saving the redux store in file exposed on window
// Save the console function in the console once
(function (console) {
console.save = function (data, filename) {
if (!data) {
console.error('Console.save: No data')
return
}
if (!filename) {
filename = 'console.json'
@M-ZubairAhmed
M-ZubairAhmed / quick-connect.js
Created November 26, 2020 03:35
Connect to all Linkedin connection on a page with js
// Edit the classname of the connect button on Linkedin
const connectButtonClassname = "full-width artdeco-button artdeco-button--2 artdeco-button--full artdeco-button--secondary ember-view"
const allButtons = document.getElementsByClassName(connectButtonClassname)
const allButtonsArray = Array.from(allButtons)
if (allButtonsArray.length > 0){
allButtonsArray.forEach(function(button){
if (button.innerText === "Connect"){
@M-ZubairAhmed
M-ZubairAhmed / New Caesar Encryption.java
Created March 22, 2017 04:30
Algorithm for improved version of Caesar encryption with variable key
/**
* This method is for encription of text.
* @param s The input text which is to be encrypted
* @param shift The initial key value to be executed at the first
* letter of the text.
* @param incremental The number by which the value of key is increased.
* @return The encrypted text is returned.
**/
public static String movingShift(String s, int shift, int incremental){
@M-ZubairAhmed
M-ZubairAhmed / all-of-my-meetups.md
Last active May 11, 2021 10:47
My meetups descriptions

My meetup descriptions

In the following you can find small introductions to my meetups

@M-ZubairAhmed
M-ZubairAhmed / endspoints-exercide.json
Created December 4, 2020 13:09
Excercises for Django
[
{
"endpoint": "/api/exercise/new-user",
"method": "POST",
"postdata": {
"username": ""
},
"returndata": {
"_id": "",
"username": ""
@M-ZubairAhmed
M-ZubairAhmed / input.scss
Last active December 1, 2020 14:20
Tailwind inspired utility classeses, generated by SassMeister.com.
$spacing-scale: (
"-0": 0px,
"": 1px,
"half": 0.125rem,
"-1": 0.25rem,
"1half": 0.375rem,
"-2": 0.5rem,
"2half": 0.625rem,
"-3": 0.75rem,
"3half": 0.875rem,