Skip to content

Instantly share code, notes, and snippets.

View arafatamim's full-sized avatar
📚
Busy with studies

Tamim Arafat arafatamim

📚
Busy with studies
View GitHub Profile
@arafatamim
arafatamim / boxit.py
Created June 30, 2019 08:53
Python method to wrap text in box
def boxit(input, borderStyle="-", tl="+", tr="+", bl="+", br="+"):
line1 = tl + borderStyle * (len(input)+2) + tr
line2 = "| " + input + " |"
line3 = bl + borderStyle * (len(input)+2) + br
result = '''{0}
{1}
{2}'''.format(line1, line2, line3)
return result
#!/usr/bin/env python3
import json
import subprocess
from pathlib import Path
venv_path = subprocess.check_output("poetry env info --path".split())
venv_path = venv_path.decode("UTF-8")
settings = dict()
set tabstop=2
set shiftwidth=2
set expandtab
"compiler fish
setlocal textwidth=79
"setlocal foldmethod=expr
call plug#begin('~/.nvim/plugins')
Plug 'tpope/vim-sensible'
{
"name": "Vimium C",
"@time": "21/08/2020, 02:18:07",
"time": 1597954687494,
"environment": {
"extension": "1.84.3",
"platform": "linux",
"chrome": 84
},
"keyMappings": [
{
"name": "Vimium C",
"@time": "21/08/2020, 02:23:14",
"time": 1597954994786,
"environment": {
"extension": "1.84.3",
"platform": "linux",
"chrome": 84
},
"keyMappings": [
{
"name": "Vimium C",
"@time": "23/08/2020, 02:09:36",
"time": 1598126976277,
"environment": {
"extension": "1.84.3",
"platform": "linux",
"chrome": 84
},
"keyMappings": [
@arafatamim
arafatamim / export.json
Created November 6, 2021 17:06
Among Us animation frames exported from pixelartcss.com
{"frames":[{"grid":["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","rgba(0, 0, 0, 1)","rgba(0, 0, 0, 1)","rgba(0, 0, 0, 1)","","","","","","","","","","","","","","","","rgba(0, 0, 0, 1)","rgba(0, 0, 0, 1)","rgba(210,3,3,1)","rgba(210,3,3,1)","rgba(210,3,3,1)","rgba(0, 0, 0, 1)","rgba(0, 0, 0, 1)","","","","","","","","","","","","","rgba(0, 0, 0, 1)","rgba(210,3,3,1)","rgba(210,3,3,1)","rgba(210,3,3,1)","rgba(210,3,3,1)","rgba(210,3,3,1)","rgba(210,3,3,1)","rgba(210,3,3,1)","rgba(0, 0, 0, 1)","","","","","","","","","","","rgba(0, 0, 0, 1)","rgba(0, 0, 0, 1)","rgba(0, 0, 0, 1)","rgba(0, 0, 0, 1)","rgba(0, 0, 0, 1)","rgba(0, 0, 0, 1)","rgba(210,3,3,1)","rgba(210,3,3,1)","rgba(210,3,3,1)","rgba(0, 0, 0, 1)","","","","","","","","","","","rgba(0, 0, 0, 1)","rgba(0, 188, 212, 1)","rgba(255, 255, 255, 1)","rgba(255, 255, 255, 1)","rgba(0, 188, 212, 1)","rgba(
@arafatamim
arafatamim / mpris.sh
Last active February 10, 2022 09:24
MPRIS commands using dbus-send & busctl
#!/usr/bin/env sh
# API Reference: https://specifications.freedesktop.org/mpris-spec/2.2/Player_Interface.html
# (property) Get volume
dbus-send --print-reply --session --dest=org.mpris.MediaPlayer2.cmus \
/org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get \
string:'org.mpris.MediaPlayer2.Player' \
string:'Volume'
busctl --user get-property org.mpris.MediaPlayer2.cmus \
/*
* "Donut math: how donut.c works" blog post by Andy Sloane:
* https://www.a1k0n.net/2011/07/20/donut-math.html
* Relevant video: https://www.youtube.com/watch?v=DEqXNfs_HhY
*/
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <unistd.h>
GTA SA 1.0.0.0 US
Unhandled exception at 0x18D68E70 in GTA_SA.EXE: 0xC000001D: Illegal instruction..
Register dump:
EAX: 0x18D68FF0 EBX: 0x00000001 ECX: 0x18D68E70 EDX: 0x00000000
EDI: 0x18D68E70 ESI: 0x01B613B0 EBP: 0x0177F5B8 EIP: 0x18D68E70
ESP: 0x0177F598 EFL: 0x00010202 CS: 0x00000023 SS: 0x0000002B
GS: 0x0000006B FS: 0x00000063 ES: 0x0000002B DS: 0x0000002B
Stack dump:
0x0177F598: 03925CA1 0177F5A8 01B61230 01B613B0 42793F88 C39302D7