Skip to content

Instantly share code, notes, and snippets.

View sumn2u's full-sized avatar
🌎

Suman Kunwar sumn2u

🌎
View GitHub Profile
@sumn2u
sumn2u / auto.csv
Created January 9, 2024 20:19
car price dataset
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 26 columns, instead of 10 in line 8.
3,?,alfa-romero,gas,std,two,convertible,rwd,front,88.6,168.8,64.1,48.8,2548,dohc,four,130,mpfi,3.47,2.68,9.0,111,5000,21,27,13495
3,?,alfa-romero,gas,std,two,convertible,rwd,front,88.6,168.8,64.1,48.8,2548,dohc,four,130,mpfi,3.47,2.68,9.0,111,5000,21,27,16500
1,?,alfa-romero,gas,std,two,hatchback,rwd,front,94.5,171.2,65.5,52.4,2823,ohcv,six,152,mpfi,2.68,3.47,9.0,154,5000,19,26,16500
2,164,audi,gas,std,four,sedan,fwd,front,99.8,176.6,66.2,54.3,2337,ohc,four,109,mpfi,3.19,3.40,10.0,102,5500,24,30,13950
2,164,audi,gas,std,four,sedan,4wd,front,99.4,176.6,66.4,54.3,2824,ohc,five,136,mpfi,3.19,3.40,8.0,115,5500,18,22,17450
2,?,audi,gas,std,two,sedan,fwd,front,99.8,177.3,66.3,53.1,2507,ohc,five,136,mpfi,3.19,3.40,8.5,110,5500,19,25,15250
1,158,audi,gas,std,four,sedan,fwd,front,105.8,192.7,71.4,55.7,2844,ohc,five,136,mpfi,3.19,3.40,8.5,110,5500,19,25,17710
1,?,audi,gas,std,four,wagon,fwd,front,105.8,192.7,71.4,55.7,2954,ohc,five,136,mpfi,3.19,3.40,8.5,110,5500,19,25,18920
1,158,audi,gas,turbo,four,sedan,fwd,front,10
@sumn2u
sumn2u / Nepal-Population-Density-Map.R
Last active January 5, 2024 02:47
Population density map of Nepal (3D)
install.packages("sf",dependencies=TRUE)
install.packages("tmap",dependencies=TRUE)
install.packages("mapview",dependencies=TRUE)
install.packages("stars",dependencies=TRUE)
install.packages("rayshader",dependencies=TRUE)
install.packages("MetBrewer",dependencies=TRUE)
install.packages("rayrender")
install.packages("extrafont",dependencies=TRUE)
install.packages("magick",dependencies=TRUE)
@sumn2u
sumn2u / Slovenia.R
Created January 2, 2024 19:06
Slovenia Forest Map
#############################################
Slovenia
#############################################
# 1. PACKAGES
# require(remotes)
# install_version("rayshader", version = "0.35.7", repos = "http://cran.us.r-project.org")
libs <- c(
@sumn2u
sumn2u / launch.json
Created April 6, 2023 14:52
Launch configurations for debugging jest test spec and application
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:8080",
"webRoot": "${workspaceRoot}/src",
"sourceMaps": true
@sumn2u
sumn2u / interval.hook.ts
Created November 8, 2022 14:31 — forked from Danziger/interval.hook.ts
✨ Declarative useTimeout (setTimeout), useInterval (setInterval) and useThrottledCallback (useCallback combined with setTimeout) hooks for React (in Typescript)
import React, { useEffect, useRef } from 'react';
/**
* Use setInterval with Hooks in a declarative way.
*
* @see https://stackoverflow.com/a/59274004/3723993
* @see https://overreacted.io/making-setinterval-declarative-with-react-hooks/
*/
export function useInterval(
callback: React.EffectCallback,
@sumn2u
sumn2u / db.json
Created October 4, 2022 13:49
JSON file example for hai-server
{
"posts":[
{
"id":1,
"title":"hai-server",
"author":"sumn2u"
}
],
"comments":[
{
@sumn2u
sumn2u / example.json
Created October 4, 2022 13:47
JSON example for restricting API through hai-server
{
"secretKey":"123456789",
"expiresIn":"1h",
"users":[
{
"id":1,
"name":"bruno",
"email":"[email protected]",
"password":"bruno"
},
@sumn2u
sumn2u / 404.html
Last active June 1, 2022 18:48
An example of 404 using Yuno Design Kit
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>CodePen - Yuno 404</title>
<link rel='stylesheet' href='https://unpkg.com/[email protected]/build/style.1.1.8.css'>
</head>
<body>
<!-- partial:index.partial.html -->
<body class="background background--light background--dark container">
@sumn2u
sumn2u / index.html
Created May 31, 2022 15:43
Yuno 404
<body class="background background--light background--dark container">
<section class="page_404 text-center">
<div class="row">
<div class="col-sm-12 ">
<div class="col-sm-10 col-sm-offset-1">
<div class="four_zero_four_bg">
<img src='https://cdn.dribbble.com/users/285475/screenshots/2083086/dribbble_1.gif' class='four_zero_four_bg_img' height="40%" />
</div>
<div class="contant_box_404">
<h3 class="h2">
@sumn2u
sumn2u / test.py
Created May 12, 2021 17:12
testing script
leeted = """L0r3m ip5um d010r 5i7 4m37, c0n53c737ur 4dipi5cing 31i7. A3n34n id c0nv411i5 31i7. Pr0in c0mm0d0 u7 7311u5 n0n viv3rr4. V357i8u1um gr4vid4 nunc 53d ni5i u17rici35 d4pi8u5. In 4uc70r 70r70r u7 dui f4uci8u5, vi743 p0r74 m4554 7incidun7. M0r8i id 4rcu ni8h. L0r3m ip5um d010r 5i7 4m37, c0n53c737ur 4dipi5cing 31i7. P3113n735qu3 73mpu5, ip5um vi743 in73rdum 814ndi7, 4n73 0rci 4uc70r 4ugu3, id 5c313ri5qu3 53m ni51 14cini4 0rci. Ph45311u5 c0ngu3 ju570 id in73rdum 0rn4r3. Ph45311u5 ru7rum 3r47 5i7 4m37 ip5um 53mp3r p14c3r47. V357i8u1um 54gi77i5 13c7u5 47 ip5um v3n3n47i5 p3113n735qu3. Nu114m in 7incidun7 70r70r, id h3ndr3ri7 qu4m. M0r8i 37 c0n53qu47 m37u5. M0r8i v3n3n47i5 13c7u5 n0n n3qu3 u17ric35, n3c 0rn4r3 nu114 ru7rum. M43c3n45 cur5u5 dui 5i7 4m37 54pi3n in73rdum, 3g37 dic7um ju570 1080r7i5. S3d 37 dui c0ndim3n7um, c0ngu3 ip5um u7, 313if3nd ni8h. Fu5c3 47 53m 3u 54pi3n dic7um 5c313ri5qu3."""
item_raw = leeted.split(" ")
print(item_raw)
items_clean = leeted.replace(",","").split(" ")
print(items_clea