Skip to content

Instantly share code, notes, and snippets.

View ShawonAshraf's full-sized avatar

Shawon Ashraf ShawonAshraf

View GitHub Profile
@ShawonAshraf
ShawonAshraf / main.py
Created March 11, 2022 15:07
file op
import os
from tqdm import tqdm
train_dir = os.path.join(os.getcwd(), "data", "train")
test_dir = os.path.join(os.getcwd(), "data", "test")
# merge all text from the txt files
# returns a list
\documentclass[11pt]{report}
\usepackage[utf8]{inputenc}
% set margin
\usepackage[a4paper, margin=2.0cm]{geometry}
\addtolength{\leftmargin}{2.5cm}
% page numbering
\pagenumbering{gobble}
@ShawonAshraf
ShawonAshraf / set8.py
Created January 24, 2022 11:18
sample I/O for set8
#input
['S',
['NP-SBJ',
['NP',
['DT', 'The'],
['NN', 'cat']
]
],
['VP',
['VB', 'chases'],
@ShawonAshraf
ShawonAshraf / prime.py
Created December 12, 2021 09:32
sieve prime example
import math
import argparse
argument_parser = argparse.ArgumentParser()
argument_parser.add_argument("--n", type=int, required=True)
args = argument_parser.parse_args()
def is_prime(n):
if n == 1:
# fragments
from fragments import get_random_text
def easy_password(length: int):
psw = ""
while len(psw) != length:
chunk = psw + get_random_text()
if (len(chunk)-length == 1) or ((len(chunk) > length)):
psw = psw
@ShawonAshraf
ShawonAshraf / Steam_Proton_Exe.md
Created November 21, 2021 05:37 — forked from michaelbutler/Steam_Proton_Exe.md
How to run another .exe in an existing proton wine prefix

Running games through Steam's Proton is great. But what if there is a secondary exe or configuration application bundled with the game? How can you launch it if Steam itself only launches the game?

Simply run this command in a terminal:

cd /path/to/steam/steamapps/compatdata/20920/pfx

STEAM_COMPAT_DATA_PATH="/path/to/steam/steamapps/compatdata/20920" WINEPREFIX=$PWD \
    "$HOME/.steam/root/steamapps/common/Proton 5.0/proton" run ./drive_c/path/to/custom_application.exe
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@ShawonAshraf
ShawonAshraf / main.py
Created October 8, 2021 15:00
A script to generate information for filling out the annoying davinci resolve download form.
#! /usr/bin/python3
import random
"""
A script to generate information for filling out the
annoying davinci resolve download form.
Required fields in the Davinci Resolve Download form:
@ShawonAshraf
ShawonAshraf / gnome-terminal-profiles.adoc
Created August 31, 2021 01:49
Export / Import Gnome Terminal Profiles

Export Gnome Terminal Profile

List profiles

dconf dump /org/gnome/terminal/legacy/profiles:/

Determine the terminal profile string for the profile you will need. This is the terminal profile that I will export:

@ShawonAshraf
ShawonAshraf / NatualScrollingInWindows.ps1
Created April 30, 2021 02:06 — forked from 101v/NatualScrollingInWindows.ps1
Powershell script to enable natural scrolling in Windows
# View registry settings
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0
# Change registry settings
# Reverse mouse wheel scroll FlipFlopWheel = 1
# Normal mouse wheel scroll FlipFlopWheel = 0
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 }
# Restore default scroll direction
# Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 1 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 0 }