Skip to content

Instantly share code, notes, and snippets.

View aishraj's full-sized avatar

Aish aishraj

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aishraj
aishraj / notes_little_book_of_semaphores.md
Created January 22, 2023 18:31 — forked from jlerche/notes_little_book_of_semaphores.md
Notes on implementing synchronization techniques using semaphores, in rust, from The Little Book of Semaphores

Link to the book

Semaphore implementation in rust taken from the previously deprecated std-semaphore

Chapter 3

3.3 Rendezvous

If you have two threads, executing the following:

| Thread A | Thread B |

@aishraj
aishraj / hello_map.py
Created November 6, 2019 12:08 — forked from lizrice/hello_map.py
eBPF hello world
#!/usr/bin/python
from bcc import BPF
from time import sleep
# This outputs a count of how many times the clone and execve syscalls have been made
# showing the use of an eBPF map (called syscall).
program = """
BPF_HASH(syscall);
@aishraj
aishraj / two.php
Last active December 4, 2018 15:31
<?hh // strict
namespace adventofcode\two;
use namespace HH\Lib\C;
<<__Entrypoint>>
async function main(): Awaitable<noreturn> {
$file_contents = await read_file("input.txt");
$parsed_items = \explode("\n", $file_contents);
@aishraj
aishraj / swap.rs
Created February 10, 2018 23:45
Swap 2 fields of a struct rust
#[derive(Debug)]
pub struct Demo {
f: i32
}
#[derive(Debug)]
pub struct Other {
a: Demo,
b: Demo
@aishraj
aishraj / keybase.md
Created February 5, 2016 07:40
keybase.md

Keybase proof

I hereby claim:

  • I am aishraj on github.
  • I am aishraj (https://keybase.io/aishraj) on keybase.
  • I have a public key whose fingerprint is 3A8F 29F5 61D3 386C 7BB0 1BCE 5737 9059 A1D4 15EE

To claim this, I am signing this object:

public class AnimatedActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
//opening transition animations
overridePendingTransition(R.anim.activity_open_translate,R.anim.activity_close_scale);
}
@aishraj
aishraj / TrapeziumIntegral.java
Created April 21, 2013 06:09
A project stuff
package trapeziumIntegral;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import mathematics.IntervalInterface;
import mathematics.MathFunctionInterface;
/*

This Python script creates a git repo with your tweets. Obviously its limited by Twitter API limitations as you cannot retrieve more than 3200 tweets at a time.

Given the fact that Twitter doesn't give a fuck about our data, you may not find your old tweets ever again. So nothing is better than keeping an archive of tweets as a Git repo.

This is inspired by @holman's tweets repo. But this doesn't have a dependency on Madrox. Just plain Python and Git.

Usage

To create an archive of tweets initiate a git repo in a directory with git init. Then put the script in the directory and execute: