Skip to content

Instantly share code, notes, and snippets.

View salmanmorshed's full-sized avatar

Salman Morshed salmanmorshed

  • Khulna, Bangladesh
View GitHub Profile
#!/bin/bash
read_cmd="gsettings get org.gnome.desktop.interface color-scheme"
watch_cmd="gsettings monitor org.gnome.desktop.interface color-scheme"
conf_path="$HOME/.config/gtk-3.0/settings.ini"
function setDarkMode() {
sed -i "s/^gtk-application-prefer-dark-theme=.*/gtk-application-prefer-dark-theme=$1/" $conf_path
echo "Set darkmode value to $1"
}
@salmanmorshed
salmanmorshed / version.py
Created September 30, 2023 10:41
Handy script for bumping semvers in pyproject.toml
import argparse
import sys
import semver
import tomlkit
def read_version_from_pyproject() -> semver.Version:
with open("pyproject.toml", "r") as file:
pyproject = tomlkit.load(file)
let finalData = {};
function collectData() {
const dataTable = document.querySelectorAll('table[style=\'border-collapse:collapse;\'] tr:not([height="30"])');
for (let row of dataTable) {
let cells = row.cells;
let courseId = cells[1].innerText.trim();
let courseName = cells[2].innerText.trim();
let grade = cells[5].innerText.trim();
let credit = parseFloat(cells[3].innerText.trim());
@salmanmorshed
salmanmorshed / PatchWebDriver.sh
Created October 31, 2015 12:02
Execute script inside the directory containing Nvidia Web Driver installer to create a patched copy
#!/bin/bash
# =========================================================================
# Patches Nvidia Web Driver installers for installing on non-MacPro devices
# By: Md. Salman Morshed - [email protected]
# =========================================================================
PKG_FILE="$(ls | grep WebDriver | head -1)"
TMP_DIR="$PKG_FILE.temp"
@salmanmorshed
salmanmorshed / autoexec_cfg
Last active October 4, 2016 00:03
Zed's UrT Config
// ==================================== //
// ZED'S PERSONAL KEYBINDS AND SETTINGS //
// ------------------------------------ //
// *** Last updated @ 4 Oct 2016 *** //
// ==================================== //
//Personal
//set m_filter "0"
//set sensitivity 2.20 // 2400 CPI & OS X 0.0 mouse scaling
@salmanmorshed
salmanmorshed / urtscore.py
Last active December 30, 2015 18:49
Module to calculate the individual scores of all players from a games.log file generated by Urban Terror.
#!/usr/bin/env python
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the