Skip to content

Instantly share code, notes, and snippets.

const std = @import("std");
const net = std.net;
const fs = std.fs;
const os = std.os;
pub const io_mode = .evented;
pub fn main() anyerror!void {
var general_purpose_allocator = std.heap.GeneralPurposeAllocator(.{}){};
const allocator = general_purpose_allocator.allocator();
const std = @import("std");
fn splice(src_rd: anytype, dst_wr: anytype, comptime buf_len: usize, lim: usize) !void {
var buf: [buf_len]u8 = undefined;
var left = lim;
while (true) {
const len = try src_rd.read(buf[0..@min(left, buf.len)]);
if (len == 0) break;
left = try std.math.sub(usize, left, len);
try dst_wr.writeAll(buf[0..len]);
@rofrol
rofrol / zig_update.zig
Last active July 7, 2023 06:33 — forked from doccaico/zig_update.zig
Ziglang Updater in Ziglang
We couldn’t find that file to show.
@rofrol
rofrol / win11-mouse-scroll-reverse.md
Created March 3, 2023 13:51 — forked from gagarine/win11-mouse-scroll-reverse.md
Reverse Mouse Wheel scroll in Windows 11 (Natural Mode like MacOS)

Reverse Mouse Wheel scroll in Windows 11

Chose between natural mode like MacOS or Windows default mode.

Step 1: Open Windows PowerShell in Administrator Mode.

You can do this by going to Start Menu, type PowerShell, and click Run as Administrator.

Step 2: Copy the following code and paste it in the command line of Windows PowerShell:

$mode = Read-host "How do you like your mouse scroll (0 or 1)?"; Get-PnpDevice -Class Mouse -PresentOnly -Status OK | ForEach-Object { "$($_.Name): $($_.DeviceID)"; Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters" -Name FlipFlopWheel -Value $mode; "+--- Value of FlipFlopWheel is set to " + (Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters").FlipFlopWheel + "`n" }
@rofrol
rofrol / main.zig
Created August 8, 2022 14:47 — forked from doccaico/main.zig
Conway's Game of Life
// Build: zig build-exe -O ReleaseFast --strip src/main.zig
// Run: zig build run -- -w 70 -h 40 -m "*" -s 0.07 -c 25
// Version: 0.10.0-dev.3475+b3d463c9e
// Date: 2022/08/08
const std = @import("std");
const mem = std.mem;
const fmt = std.fmt;
const os = std.os;
  • ## To watch
  • Ergo Proxy (2006-) TV
  • fargo 2 - [ ] Burnt (2015)
  • Bone Tomahawk (2015)
  • Black Sails (2014)
  • Macbeth (2015)
  • A Few Good Men (1992)
  • ## Postapocalyptic
  • Mad Max (1979) i reszta części
  • Water world (1995)
@rofrol
rofrol / rx.js
Created March 21, 2022 13:02 — forked from msociety/rx.js
André Staltz (@andrestaltz): You will learn RxJS at ng-europe 2016
/*
* André Staltz (@andrestaltz): You will learn RxJS at ng-europe 2016
* https://www.youtube.com/watch?v=uQ1zhJHclvs
*/
function map(transformFn) {
const inputObservable = this;
const outputObservable = createObservable(function subscribe(outputObserver) {
inputObservable.subscribe({
next: function(x) {
@rofrol
rofrol / .gitignore
Last active January 17, 2022 16:20
Rust + Rocket + rust-postgres
target