Skip to content

Instantly share code, notes, and snippets.

View shawonashraf's full-sized avatar
🐈
I'm simply not there.

Shawon Ashraf shawonashraf

🐈
I'm simply not there.
View GitHub Profile
\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 }
@shawonashraf
shawonashraf / mac_gym_installer.sh
Created April 11, 2021 23:39 — forked from andrewschreiber/mac_gym_installer.sh
Installs OpenAI Gym on MacOS -
#!/bin/sh
# See video https://www.youtube.com/watch?v=7PO27i2lEOs
set -e
command_exists () {
type "$1" &> /dev/null ;
}