Skip to content

Instantly share code, notes, and snippets.

View sanmai's full-sized avatar

Alexey Kopytko sanmai

View GitHub Profile

Corsair Link Node Documentation

USB ID 1b1c:0c04 is shared by several legacy Corsair Link devices, including at least:

  • Corsair H80i, H100i, H110i GT (AIO coolers)
  • Corsair Link Cooling Node
  • Corsair Commander Mini (fan + temperature + RGB controller)

They all present as a single "Integrated USB Bridge" HID endpoint that fronts

@sanmai
sanmai / README.md
Last active May 6, 2026 23:34
zeVirtualMemQueryPageSize probe

Probes zeVirtualMemQueryPageSize across a range of allocation sizes to see how Battlemage L0 actually scales the page size and compares that with what public API returns.

Device: Intel(R) Arc(TM) Pro B60 Graphics
request      | page size   
-------------+-------------
1 B          | 64.00 KiB   
4.00 KiB     | 64.00 KiB   
64.00 KiB    | 64.00 KiB   
1.00 MiB | 64.00 KiB 
composer.lock
vendor
@sanmai
sanmai / merge_dna_files.rb
Created August 15, 2022 02:54 — forked from plashchynski/merge_dna_files.rb
Tool to merge 23andme and Ancestory.com raw dna files
#!/usr/bin/ruby
#
# Usage:
# ruby ./merge_dna_files.rb file,file1,file2... > merged_file.txt
#
# Example:
# ruby ./merge_dna_files.rb AncestryDNA.txt genome_John_Doe_v4_Full_20170428065226.txt > merged_raw.txt
#
# Supports 23andMe, AncestryDNA, and Genes for Good 23andMe compatible file formats.
# The result will be in 23andMe file format.
# add to .profile
set-title () {
# If the length of string stored in variable `PS1_BAK` is zero...
# - See `man test` to know that `-z` means "the length of STRING is zero"
if [[ -z "$PS1_BAK" ]]; then
# Back up your current Bash Prompt String 1 (`PS1`) into a global backup variable `PS1_BAK`
PS1_BAK="$PS1"
fi
@sanmai
sanmai / Count Code lines.sh
Created October 5, 2020 05:16 — forked from amitchhajer/Count Code lines
Count number of code lines in git repository per user
git ls-files | xargs -n1 git blame --line-porcelain | sed -n 's/^author //p' | sort -f | uniq -ic | sort -nr
@sanmai
sanmai / WP REST API Controller Class.php
Last active September 25, 2020 08:14 — forked from ViewFromTheBox/WP REST API Controller Class
This is the base WP REST API Controller class
<?php class Sports_Bench_Team_REST_Controller extends WP_REST_Controller {
/**
* Register the routes for the objects of the controller.
*/
public function register_routes() {
$namespace = 'sportsbench';
$base = 'teams';
register_rest_route( $namespace, '/' . $base, array(
array(
@sanmai
sanmai / isset_vs_array_key_exists.php
Last active March 20, 2020 03:16 — forked from alcaeus/in_array_vs_isset_vs_array_key_exists.php
Performance comparision: isset vs. array_key_exists
<?php
function testPerformance($name, Closure $closure, $runs)
{
$start = microtime(true);
for (; $runs > 0; $runs--)
{
$_ = $closure();
}
$end = microtime(true);
@sanmai
sanmai / example.txt
Last active April 20, 2019 15:12
Signed file example
Example