Skip to content

Instantly share code, notes, and snippets.

View AnimeshRy's full-sized avatar
🏠
Working from home

Animesh AnimeshRy

🏠
Working from home
View GitHub Profile
@AnimeshRy
AnimeshRy / Caesar.c
Created December 6, 2019 10:14
Easy Caesar CS50 version
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <cs50.h>
int main(int argc, string args[])
{
if (argc != 2)
{
@AnimeshRy
AnimeshRy / vigenere.c
Last active December 6, 2019 10:33
CS50 Vigenere 2019
#include <cs50.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, string argv[])
{
// Check if correct # of arguments given
if (argc != 2)
@AnimeshRy
AnimeshRy / readability.c
Last active January 2, 2020 07:50
Readability Using Coleman-Liau index
#include <stdio.h>
#include <cs50.h>
#include <ctype.h>
#include <string.h>
#include <math.h>
int letter;
int word;
int sentence;
@AnimeshRy
AnimeshRy / runoff.c
Last active June 26, 2024 19:39
CS50 Runoff Pset3
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
// Max voters and candidates
#define MAX_VOTERS 100
#define MAX_CANDIDATES 9
@AnimeshRy
AnimeshRy / plurality.c
Created January 6, 2020 22:36
Plurality Pset 2 CS50
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
// Max number of candidates
#define MAX 9
@AnimeshRy
AnimeshRy / bashy.sh
Created May 25, 2020 19:26
cheatsheetbash
#! /bin/bash
# ECHO COMMAND
# echo Hello World!
# VARIABLES
# Uppercase by convention
# Letters, numbers, underscores
NAME="Bob"
# echo "My name is $NAME"
@AnimeshRy
AnimeshRy / commitbot.py
Created May 17, 2021 21:54
Git Commit Bot
from time import sleep
import os
count=1
def update():
if 'a.txt' in os.listdir():
os.system('rename a.txt b.txt') #Renames file
elif 'b.txt' in os.listdir():
os.system('rename b.txt a.txt') #Renames file

Keybase proof

I hereby claim:

  • I am AnimeshRy on github.
  • I am era5tone (https://keybase.io/era5tone) on keybase.
  • I have a public key whose fingerprint is E825 374C 380C 3EFA 82B3 FF22 A6F1 6351 CCAA 205B

To claim this, I am signing this object:

@AnimeshRy
AnimeshRy / gist:54dfc9f0b20c84ea203513097ed81556
Created February 6, 2022 17:17
WSL2 Ubuntu NPM Install Slow Fix
I tried every solutions here, but nothing works for me.
But I found solutions.
in wsl, type below.
sudo rm /etc/resolv.conf
sudo bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf'
sudo bash -c 'echo "[network]" > /etc/wsl.conf'
sudo bash -c 'echo "generateResolvConf = false" >> /etc/wsl.conf'
sudo chattr +i /etc/resolv.conf
@AnimeshRy
AnimeshRy / forwarder.py
Created April 22, 2023 10:41 — forked from LiveOverflow/forwarder.py
TCP Forwarder
import socket
import select
from logzero import logger
# python forwarder.py localhost:1337 ipinfo.io:80
# curl -v http://localhost.com:1337 -H "Host: ipinfo.io"
# video: https://www.youtube.com/watch?v=32KKwgF67Ho
class Forwarder: