Skip to content

Instantly share code, notes, and snippets.

View quackduck's full-sized avatar
running...

Ishan Goel quackduck

running...
View GitHub Profile
@quackduck
quackduck / sniff2.c
Last active December 24, 2023 11:28
wifi packet sniffer
#include <pcap.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <pcap.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@quackduck
quackduck / prime.c
Created November 20, 2023 06:59
prime.c
#include <stdio.h>
#include <math.h>
#define TARGET 1000000
int main() {
long long found = 0;
long long num = 2;
while (found < TARGET) {
long long till = sqrtl(num);
package main
import (
"errors"
"fmt"
"image"
"image/color"
"image/png"
"math"
"os"
@quackduck
quackduck / main.go
Created August 7, 2022 01:57
Stupid hash function made on a plane without WiFi
// go build
// ./main "random string"
// 2f4563a971944e00
package main
import (
"fmt"
"os"
)
@quackduck
quackduck / main.py
Created June 10, 2022 03:48
random color sierpinski triangle
import turtle
import random
def randColor():
t.color(random.random(), random.random(), random.random())
def draw_sierpinski(length, depth):
if depth==0:
for i in range(0,3):
@quackduck
quackduck / duckcoin.exe.base64
Created May 18, 2022 15:23
duckcoin-windows
This file has been truncated, but you can view the full file.
@quackduck
quackduck / AssertVerifier.java
Created February 9, 2022 02:42
Solve AP CS A assertion problems automatically
package assertion;
import java.util.ArrayList;
public class AssertVerifier {
static int numConditions = 3;
static int numPoints = 5;
// numbers to test
static int start = -100000;
public class Projectile {
public double angleOfLaunch; // in radians
public double initialX; // in meters
public double initialVelocity; // in m/s
public boolean useTimeToMaxHeight = false;
private double gravity; // m/s^2
package main
import (
"bufio"
"io"
"io/ioutil"
"math/rand"
"os"
"strings"
"time"