Skip to content

Instantly share code, notes, and snippets.

View RafayGhafoor's full-sized avatar
🎯
Focusing

Muhammad Rafay Awan RafayGhafoor

🎯
Focusing
View GitHub Profile
for (let i=0; i< 40;i++) {
try {
document.getElementsByName(`radios[${i}]`)[0].checked = true;
} catch {
console.log("Error");
}
}
document.getElementById("submit").click();
# coding=utf-8
import pickle
import time
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
import re
import requests
import os
import sys
sudo rm -f /etc/X11/xorg.conf
sudo rm -f xorg.conf*
sudo service lightdm stop
sudo service gdm stop
sudo service kdm stop
sudo service lxdm stop
sudo service xdm stop
sudo service wdm stop
sudo Xorg -configure
[ -f xorg.conf* ] && sudo mv xorg.conf* /etc/X11/xorg.conf
URL GOTO=http://flexstudent.nu.edu.pk/Student/CourseFeedback
TAG POS=1 TYPE=BUTTON FORM=ACTION:/Student/FeedBackQuestions ATTR=NAME:GiveFeedback
WAIT SECONDS=2
TAG POS=1 TYPE=BUTTON FORM=ACTION:/Student/SubmitFeedback ATTR=ID:submit
@RafayGhafoor
RafayGhafoor / googleDoc_update_Header.js
Created June 11, 2020 16:01
Update google doc header with words count.
function getWC() {
var space = " ";
var active_doc = DocumentApp.getActiveDocument();
var text = active_doc.getBody().getText();
var body = active_doc.getBody();
var words = text.replace(/\s+/g, space).split(space);
var header= active_doc.getHeader();
var wc = (words.length);
// var completion_percentage = (wc/4500*100).toString();
header.setText("Word Count: " + wc.toString());
{"lastUpload":"2021-07-20T05:43:47.834Z","extensionVersion":"v3.4.3"}
#include <cstring>
#include <fstream>
#include <iostream>
using namespace std;
class Page {
char *id, *title;
friend class SocialNetwork;
#include <cstring>
#include <fstream>
#include <iostream>
using namespace std;
class Helper {
public:
static int StringLenght(char* str) {
// This function should return lenght of str
// oop classwork.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <cstring>
#define SMALL 0
#define MEDIUM 1
#define LARGE 2
# A gist for obtaining an online viewable url for jupyter notebook
import re
url = input("Please enter url: ")
cleaned_url = re.search('(https?://)?(www)?(?P<url>.*)', url).group('url')
domains = ['.com', '.org', '.in']
for dom in domains:
if dom in cleaned_url:
cleaned_url = cleaned_url.replace(dom, '')