Skip to content

Instantly share code, notes, and snippets.

View uygary's full-sized avatar
💸
That's why we have to destroy the present politico-economic system.

Uygar Yilmaz uygary

💸
That's why we have to destroy the present politico-economic system.
View GitHub Profile
@Promit
Promit / partition_mach2.sh
Created September 13, 2024 21:35
Simplified Linux partitioning script for Seagate Mach.2 drives
#!/bin/bash
# Check if a LUN is provided as an argument
if [ -z "$1" ]; then
echo "Usage: $0 <lun-from-/dev/disk/by-id>"
exit 1
fi
# Validate the LUN path and ensure it's under /dev/disk/by-id
LUN="$1"
@AlkindiX
AlkindiX / MEMO
Last active December 9, 2025 16:39
Run machine learning on 7900XT and 7900XTX on PyTorch
Requirements:-
1. Ubuntu 22.04
2. 7900XT or 7900XTX
Pre-requests before making any installation.
Follow step 1-3 if you installed amdgpu.
1. If you already installed redeon graphic card driver from AMD using amdgpu-install. Completely remove the driver
and connect your HDMI to motherboard. Then restart your PC
@nh43de
nh43de / CloneAllRepos.ps1
Last active July 9, 2024 13:26
Clone all repos from Azure DevOps using Powershell
<#
--credits to https://blog.rsuter.com/script-to-clone-all-git-repositories-from-your-vsts-collection/
Create a file called "CloneAllRepos.config" in the same directory with
[General]
Url=??
Username=??
Password=??
@NullArray
NullArray / MAC-by-Vendor.txt
Created June 3, 2019 23:08
List of valid MAC adresses sorted by vendor
Misc MACs:
Num MAC Vendor
--- --- ------
0000 - 00:00:00 - XEROX CORPORATION
0001 - 00:00:01 - XEROX CORPORATION
0002 - 00:00:02 - XEROX CORPORATION
0003 - 00:00:03 - XEROX CORPORATION
0004 - 00:00:04 - XEROX CORPORATION
0005 - 00:00:05 - XEROX CORPORATION
0006 - 00:00:06 - XEROX CORPORATION
@ssg
ssg / dv.pas
Created August 17, 2018 18:50
Initial draft of my first attempt at developing a object-oriented GUI library, DreamView, back in 93.
{
Name:DreamView
Date:11th May 93
Update Info:
12th May 93 - Added Insert and Delete methods to DView
12th May 93 - Added REMs
12th May 93 - Recovered some bugs...
12th May 93 - Added DInputLine object
12th May 93 - Added IconButton (file based) object
@ssg
ssg / DEDEKTIF.BAS
Created October 6, 2016 00:09
Dedektif - A simple adventure/RPG-like game I wrote back in 1989 for Amstrad CPC464. This is the oldest code I wrote that I was able to scavenge from my tapes.
10 SPEED KEY 17,2
20 CLS:INK 0,0:BORDER 0:PAPER 0
30 MODE 1:INK 1,29:PEN 1:INK 2,13:INK 3,20
40 DIM I$(15),DT(15),DY$(15),SS(15),ESGY$(15):RESTORE 250
50 FOR N=1 TO 15
60 READ I$(N),DT(N),DY$(N),SS(N),ESGY$(N)
70 NEXT N
80 OK=0:YOU=0:KLL=0:FOUND=0:MONEY=1000000:CEPTEKI=0:MIDE=10:KATIL=INT(RND*15):IF KATIL<1 THEN 80
90 KATIL1=INT(RND*15):IF KATIL1<1 THEN 90
100 KATIL2=INT(RND*15):IF KATIL2<1 THEN 100
@dvdsgl
dvdsgl / Monads for a C# dev.md
Last active October 10, 2024 20:26
Monads explained (sort of) to a C# developer

A monad is a fancy word for a generic type of the form MyMonad<T> (a generic type of arity 1).

A monad is special because it adds 'special powers' to the T that it wraps. These 'special powers' won't sound very special to an imperative programmer, so you have to squint to see them but bear with me.

  • IEnumerable<T> is a monad that gives values of type T the special power of nondeterminism, or the ability to 'be' multiple values at once.
  • Nullable<T> is a monad that gives values of type T the special power of nullability, or the ability to be absent.
  • Task<T> is a monad that gives values of type T the special power of asynchronicity, or the ability to be used before they are computed.

The trick with monads comes when you want to play with the T values, because they are inside another type. C# introduced language changes to make dealing with values inside these monads easier:

@DanDiplo
DanDiplo / JS-LINQ.js
Last active February 25, 2026 17:33
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version):
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
@ssg
ssg / Microsoft.PowerShell_profile.ps1
Last active November 17, 2022 04:42
Git/Mercurial PowerShell prompt.
# ssg's powershell profile - latest version is at https://gist.github.com/ssg/5195412
# only feature is to show hg/git current branch on the prompt
$vcTypes = @(
@{
Name = "hg"
Directory = ".hg"
BranchScript = { Get-Content ".hg\branch" }
},