Skip to content

Instantly share code, notes, and snippets.

View orhun's full-sized avatar
:shipit:
I don't have a rat under my hat

Orhun Parmaksız orhun

:shipit:
I don't have a rat under my hat
View GitHub Profile
# Installation on Dell XPS 9570
# Connect to Internet
wifi-menu
# Sync clock
timedatectl set-ntp true
# Create three partitions:
@fnky
fnky / ANSI.md
Last active May 21, 2025 18:57
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@haxpor
haxpor / assert.c
Created November 3, 2018 19:27
Example of assert.c with -DNDEBUG compile flag. Try to compile with `gcc -DNDEBUG assert.c` and `gcc assert.c` to see differences.
#include <stdio.h>
#include <assert.h>
int main(int argc, char* argv[])
{
int a = 10;
assert(a != 10);
printf("end of program\n");
return 0;
}
@vaibhav93
vaibhav93 / auto_brightness.py
Last active August 11, 2020 23:16
Adjust brightness when switching to chrome workspace in i3
import i3ipc
import os
SET_BRIGHTNESS = 'xbacklight -set '
GET_BRIGHTNESS = 'xbacklight'
i3 = i3ipc.Connection()
class BrightnessController:
def __init__(self):
self.brightness_map = {}
@clickwir
clickwir / cool.sh
Last active April 10, 2021 20:18 — forked from orhun/cool.sh
Random MOD player
#!/usr/bin/env bash
# Get a random music file from modarchive.org and play it.
# Uses VLC. Many other players could work too.
# Check for needed programs. Exit if they are not found.
#if ! which xmp > /dev/null; then echo "xmp not installed. Try: apt install xmp"; exit 1; fi
if ! which vlc > /dev/null; then echo "VLC not installed. Try: apt install vlc"; exit 1; fi
if ! which curl > /dev/null; then echo "curl not installed. Try: apt install curl"; exit 1; fi
# Check if the user wants a specific module
@giuliano-macedo
giuliano-macedo / download_file.rs
Last active October 25, 2024 17:13
Download large files in rust with progress bar using reqwest, future_util and indicatif
// you need this in your cargo.toml
// reqwest = { version = "0.11.3", features = ["stream"] }
// futures-util = "0.3.14"
// indicatif = "0.15.0"
use std::cmp::min;
use std::fs::File;
use std::io::Write;
use reqwest::Client;
use indicatif::{ProgressBar, ProgressStyle};
@binji
binji / LICENSE
Last active January 9, 2025 20:55
pokegb.cc w/o macros
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
@christianparpart
christianparpart / terminal-synchronized-output.md
Last active May 7, 2025 07:11
Terminal Spec: Synchronized Output

Synchronized Output

Synchronized output is merely implementing the feature as inspired by iTerm2 synchronized output, except that it's not using the rare DCS but rather the well known SM ? and RM ?. iTerm2 has now also adopted to use the new syntax instead of using DCS.

Semantics

When rendering the screen of the terminal, the Emulator usually iterates through each visible grid cell and renders its current state. With applications updating the screen a at higher frequency this can cause tearing.

This mode attempts to mitigate that.

#!/usr/bin/env bash
(
for lib in $(pacman -Qql openssl | grep -o '[^/]*.so$'); do
for repo in core extra community testing community-testing multilib multilib-testing staging community-staging multilib-staging gnome-Unstable kde-unstable; do
sogrep $repo $lib
done
done
) | sort -u
@hnakamur
hnakamur / bounded_array_example.zig
Created February 17, 2023 23:55
Zig BoundedArray example
// Zig version: 0.10.1
// Import the standard library.
const std = @import("std");
// Define MyBoundedArray type.
const maxLength = 32;
const MyBoundedArray = std.BoundedArray(u8, maxLength);
/// Takes a slice as a parameter and fills it with a message.