Skip to content

Instantly share code, notes, and snippets.

View ms747's full-sized avatar
๐Ÿ˜Ž

Mayur Shah ms747

๐Ÿ˜Ž
  • India
View GitHub Profile
// build.rs
use std::env;
use std::fs;
use std::path::Path;
fn main() {
let out_dir = env::var("OUT_DIR").unwrap();
let dest_path = Path::new(&out_dir).join("routes.rs");
let src_path = Path::new("src/pages");
@ms747
ms747 / init.lua
Created March 5, 2023 16:44
Basic goto neovim config
local set = vim.opt
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system {
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable',
@ms747
ms747 / poll_server.c
Created October 24, 2023 10:32
Poll Server
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/epoll.h>
#define PORT 8080
#define MAX_EVENTS 256
@ms747
ms747 / io_main.c
Last active October 24, 2023 11:05
IO_Uring server
#include <errno.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <sys/poll.h>
#include <sys/socket.h>
#include <unistd.h>
import flask
import os
import psycopg2
import geojson
from dotenv import load_dotenv
from flask_cors import CORS
load_dotenv()
DB_NAME = os.getenv("DB_NAME")
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Clustered Mapbox Map</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.mapbox.com/mapbox-gl-js/v2.8.2/mapbox-gl.js'></script>
<script src="https://unpkg.com/[email protected]/dist/supercluster.min.js"></script>
<link href='https://api.mapbox.com/mapbox-gl-js/v2.8.2/mapbox-gl.css' rel='stylesheet' />
<style>