Skip to content

Instantly share code, notes, and snippets.

View epshteinmatthew's full-sized avatar
🇺🇦
Слава Україні!

epshteinmatthew epshteinmatthew

🇺🇦
Слава Україні!
View GitHub Profile
import requests
URL = "https://raw.githubusercontent.com/sys-bio/cesium/main/model_db/cesiumDB.json"
def filter(data, criteria):
return [item for item in data if all(item.get(k) == v for k, v in criteria.items())]
def filter_antimony_string(data, criteria):
return [item["antString"] for item in data if all(item.get(k) == v for k, v in criteria.items())]
@epshteinmatthew
epshteinmatthew / thing.c
Created September 21, 2022 20:43
hvdAU;KL
#include <rmsutils.h> //utils!
#include <jsmn.h> //json
#define INT_A 1306858826
#define INT_B 1130263739
#define INT_LE 2147483647
/*
stuff to do:
/**
* @file webserver.c
* @author Matthew Epshtein (epshteinmatthew@gmail.com)
* @brief The server program for SHtack, the russian roulette for nerds
* @version 1.2
* @date 2022-08-07
*
* @copyright Copyright (c) 2022
*
*
@epshteinmatthew
epshteinmatthew / file.c
Created August 21, 2022 06:43
File thingy ulfius library
FILE *fp;
fp = fopen("ykraina.jpeg", "r");
if(fseek(fp, 0L, SEEK_END) != 0){perror("seeking");return 1;};
int sz = ftell(fp);
char ch[sz];
rewind(fp);
fread(ch, 1,sz, (FILE *)fp);
ulfius_add_header_to_response(response, "Content-Type", "image/jpeg");
ulfius_set_binary_body_response(response,200,ch,sz);
@epshteinmatthew
epshteinmatthew / webserver.c
Created July 29, 2022 04:19
it needs malloc and better features, but it's something?
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>
#include <poll.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/sendfile.h>
@epshteinmatthew
epshteinmatthew / server.c
Last active July 14, 2022 13:08
Another small web server in c. Support multiple routes and(?) multiple users. IDK if post requests work/how to handle file uploads, will figure that later. oh and also a working(?) parser for my shitty json clone.
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>
#include <poll.h>
#include <string.h>
#define BACKLOG 10
#define BUFFER 1024
@epshteinmatthew
epshteinmatthew / main.c
Created June 30, 2022 17:08
Simple C Web Server from "scratch"
#include <arpa/inet.h>
#include <errno.h>
#include <stdio.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
//gcc -Wall hello.c -o webserver
//./webserver
@epshteinmatthew
epshteinmatthew / main.go
Created June 23, 2022 05:22
Start of a project i dont plan to continue.
package main
import (
"crypto/sha256"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
@epshteinmatthew
epshteinmatthew / script.sh
Created June 9, 2022 15:55
My config of KDE
git clone https://github.com/vinceliuice/Graphite-kde-theme.git
cd Graphite-kde-theme
./install.sh
cd
git clone https://github.com/PapirusDevelopmentTeam/papirus-icon-theme.git
cd papirus-icon-theme
./install.sh
@epshteinmatthew
epshteinmatthew / basicCaptcha.js
Created June 2, 2022 22:47
Captcha that uses navigator cpu info to detect prescence of a real system vs pupeteer instance or something like that. May be updated later
function captcha() {
let thing = navigator.oscpu
if (thing == undefined){
captchafail();
}
}
captcha()
function captchafail(){
//redirect or send to actual captcha
alert("in the video game")