Skip to content

Instantly share code, notes, and snippets.

View gauravssnl's full-sized avatar
😸
use code::latest ;

GAURAV gauravssnl

😸
use code::latest ;
View GitHub Profile
@kprotty
kprotty / ParkingLot.zig
Last active October 21, 2025 20:55
Small & Fast synchronization primitives for Zig
pub fn ParkingLot(comptime Config: type) type {
return struct {
pub const Lock: type = Config.Lock;
pub const Event: type = Config.Event;
pub const nanotime: fn() u64 = switch (@hasDecl(Config, "nanotime")) {
true => Config.nanotime,
@carstein
carstein / main.rs
Last active August 25, 2024 18:47
Example code in Rust using fork and ptrace
use nix::sys::ptrace;
use nix::sys::signal::Signal;
use nix::sys::wait::{WaitStatus, wait};
use nix::unistd::{fork, ForkResult, Pid};
use std::collections::HashMap;
use std::ffi::c_void;
use std::os::unix::process::CommandExt;
use std::process::{Command, exit};
@marxin
marxin / bisect.sh
Last active December 27, 2022 18:04
#!/bin/sh
TMPDIR=/dev/shm/gcc-objdir-bisect
LOG=/tmp/gcc.log
SOURCE=~/Programming/gcc2
SOURCEFILE="/home/marxin/Programming/gcc2/gcc/testsuite/gcc.dg/pr94292.c"
OPTIONS="-c -O -g -fno-tree-dce"
GREP="internal compiler"
TARGET="arm-linux-gnueabi"
@pickfire
pickfire / rust-2021.md
Last active September 18, 2020 04:25
Rust 2021 Post

Rust 2021

When I first got into Rust, I didn't know what "safety" means at all. But when I try it out, I am surprised by one thing, when it compiles, it mostly works which I kinda knows what "safety" means after that. At that time, it was also interecting to see the word "zero-cost abstraction" which sounds cool.

Sometime later, when I got back into Rust, there is one project that I started working on and found interesting, which is one of those oxiding projects. https://github.com/rust-dc/fish-manpage-completions Python to Rust, I am familier with Python but Rust seemed to similar while porting it.

Lately, not sure why but I spend more time in Rust projects. I found https://github.com/maciejhirsz/beef (compact Cow) interesting so I try making my own https://github.com/pickfire/ve (compact Vec) but it wasn't exactly faster, I did it by hand-porting bit-by-bit from alloc vec library but it was not exactly faster, then I somehow found parts to improve.

What have I been doing in Rust?

@KaustubhPatange
KaustubhPatange / publish.gradle
Last active February 5, 2021 05:04
A Gradle script to automatically publish Android library to maven or sonatype provided your central sync is enabled.
/*
* Copyright 2020 Kaustubh Patange
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@graninas
graninas / What_killed_Haskell_could_kill_Rust.md
Last active December 27, 2025 05:35
What killed Haskell, could kill Rust, too

At the beginning of 2030, I found this essay in my archives. From what I know today, I think it was very insightful at the moment of writing. And I feel it should be published because it can teach us, Rust developers, how to prevent that sad story from happening again.


What killed Haskell, could kill Rust, too

What killed Haskell, could kill Rust, too. Why would I even mention Haskell in this context? Well, Haskell and Rust are deeply related. Not because Rust is Haskell without HKTs. (Some of you know what that means, and the rest of you will wonder for a very long time). Much of the style of Rust is similar in many ways to the style of Haskell. In some sense Rust is a reincarnation of Haskell, with a little bit of C-ish like syntax, a very small amount.

Is Haskell dead?

What Hiring Should Look Like

This is definitely not the first time I've written about this topic, but I haven't written formally about it in quite awhile. So I want to revisit why I think technical-position interviewing is so poorly designed, and lay out what I think would be a better process.

I'm just one guy, with a bunch of strong opinions and a bunch of flaws. So take these suggestions with a grain of salt. I'm sure there's a lot of talented, passionate folks with other thoughts, and some are probably a lot more interesting and useful than my own.

But at the same time, I hope you'll set aside the assumptions and status quo of how interviewing is always done. Just because you were hired a certain way, and even if you liked it, doesn't mean that it's a good interview process to repeat.

If you're happy with the way technical interviewing currently works at your company, fine. Just stop, don't read any further. I'm not going to spend any effort trying to convince you otherwise.

@tonybaloney
tonybaloney / burp-soup.py
Created July 29, 2020 09:34
Integrating BeautifulSoup and BurpSuite via Jython
"""
Requirements
- Python 2.7 (Jython requirement)
- BeautifulSoup4 (Installed from Python2.7)
- http-parser
"""
from burp import IBurpExtender
from burp import IProxyListener
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <execinfo.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define BT_BUF_SIZE 100
@thealphadollar
thealphadollar / AutoConnectLinkedIn.js
Last active November 9, 2025 10:19
JS script to send connection requests to your LinkedIn search results with customisation options, accept all received connection requests, and withdraw pending sent connection requests.
// If the script does not work, you may need to allow same site scripting https://stackoverflow.com/a/50902950
Linkedin = {
config: {
scrollDelay: 3000,
actionDelay: 5000,
nextPageDelay: 5000,
// set to -1 for no limit
maxRequests: -1,
totalRequestsSent: 0,