Skip to content

Instantly share code, notes, and snippets.

View ssg's full-sized avatar
💾
restoring

Sedat Kapanoğlu ssg

💾
restoring
View GitHub Profile
@ssg
ssg / linkedin-ubo-filter.txt
Created November 5, 2023 11:17
Custom uBlock Origin filter for LinkedIn news feed
www.linkedin.com##:xpath(//span[contains(text(), 'Promoted') or contains(text(), 'Suggested') or contains(text(), 'Recommended for you')]/ancestor::div[@class='relative'])
@ssg
ssg / prog.sh
Last active August 31, 2023 21:46
APT style progress bar
#!/bin/bash
# progress bar function
prog() {
local w=80 p=$1; shift
# create a string of spaces, then change them to dots
printf -v dots "%*s" "$(( $p*$w/100 ))" ""; dots=${dots// /\#};
# print those dots on a fixed-width space plus the percentage etc.
printf "\r\e[K|%-*s| %3d %% %s" "$w" "$dots" "$p" "$*";
}
# test loop
@ssg
ssg / firefox_edge_smooth_scroll.md
Created January 10, 2023 23:06
Edge-like Firefox smooth-scroll settings for mouse wheel

set these in about:config

setting value
general.smoothScroll true
general.smoothScroll.msdPhysics.enabled false
general.smoothScroll.mouseWheel true
general.smoothScroll.mouseWheel.durationMaxMS 400
general.smoothScroll.mouseWheel.durationMinMS 400
general.smoothScroll.pages.durationMaxMS 500
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using System.Text.RegularExpressions;
namespace RegexVsToCharArray;
[MemoryDiagnoser]
public class MemoryBenchmarker
{
static readonly string[] names = { "Plague Tale", "Callisto Protocol", "God Of War", "Street Fighter 6", "Elden Ring" };

openpgp4fpr:0eca4e59f87479ecc514d5e017c60c1c1381453d

@ssg
ssg / stepper.txt
Created October 3, 2021 23:57
Stepper data from the comments at https://vimeo.com/111417458
Sub78820
Writes a value (param1 | param0) to field 10
Writes a constant (0x910200) to field 0
Spins until (field_4 & 3) == 2
Sub78848
Writes parameter 0 to field 10
Writes parameter 1 to feild 14
Writes a constant (0xA10200) to field 0
Spins until (field_4 & 3) == 2
@ssg
ssg / scf.pas
Created September 20, 2021 19:33
My attempt at a concurrent floppy disk formatter. I don't think this works though. I'm not even sure if it's possible with NEC's FDD protocol.
{ SSG's Concurrent Formatter 0.1 beta }
{$M $800,0,0}
uses
Dos,XStr,Disk,XIO;
type
@ssg
ssg / ssgkey.pas
Created September 20, 2021 19:31
Some keyboard handler I wrote. I don't remember why I started writing this.
{ SSG's Keyboard Handler - (c) 1995 SSG }
{$M $400,0,0}
uses Dos;
begin
asm
jmp @Init
@InstallText:
db 'SSG''s Keyboard Handler Version 1.00a - INSTALLED',13,10,'$'
@Old9:
@ssg
ssg / intro1.pas
Created June 17, 2021 22:01
Street Fighter II Cracktro - 1993 - This is probably the first intro I coded on PC as my coding looks really messy and basic.
{$M $4000,0,200000}
uses crt {Screen handler}
,dos {Memory handler}
,ssgstr {String handler}
,ssgbios {Keyboard & Screen handler}
,ssgcel {CEL handler}
,ssgpal; {Palette handler}
const game='Street Fighter II';
cracker='SSG';
@ssg
ssg / dumpvoc.pas
Created February 13, 2021 06:52
Tool that displays VOC (Creative Labs) voice file information I wrote in 1994
uses Dos,Objects,XVoc,XIO;
var
f:FNameStr;
H:TVOCHeader;
Block:byte;
s:string[20];
T:TDosStream;
procedure DumpBlock(b:byte);
var